You are Here: Home >< Maths

# Is there any other way to plot frequency data? Watch

1. I have some data on the number of tweets made during a 24 hour period. Apart from plotting a frequency of tweets for each hour (or each 20min segment, or 10 min....), is there any other way to show how the number of tweets made varies over the 24 period.

I was thinking along the lines of a probability density function, but I don't know how that works. Or a 'normalised' frequency graph, because I do plan on comparing each day of the week.
2. (Original post by lunnndoner)
I have some data on the number of tweets made during a 24 hour period. Apart from plotting a frequency of tweets for each hour (or each 20min segment, or 10 min....), is there any other way to show how the number of tweets made varies over the 24 period.

I was thinking along the lines of a probability density function, but I don't know how that works. Or a 'normalised' frequency graph, because I do plan on comparing each day of the week.
The usual way of doing this (if you have enough data, which I would assume you do as it's twitter!) is to use a smoother of some sort. First of all, calculate the cumulative incidence function, then smooth this cumulative function and then use whatever predict function you have available to predict the derivative of the smoothed cumulative function. For example, in "R", the following code generates incident events from a homogeneous Poisson process and then smooths the rate function.
Code:
```N <- 100
x <- cumsum(rexp(N))
smooth_cumulative <- smooth.spline(x, 1:length(x), df=5)
rate_smooth <- predict(smooth_cumulative, 0 : (N-1)), deriv=1)
plot(rate_smooth, type="l", col="blue", lwd=2)```
You'll need to experiment with the degrees of freedom in the smoother.

If you tell me what software you are using, I'll see if I can identify the right command for you.
3. (Original post by Gregorius)
The usual way of doing this (if you have enough data, which I would assume you do as it's twitter!) is to use a smoother of some sort. First of all, calculate the cumulative incidence function, then smooth this cumulative function and then use whatever predict function you have available to predict the derivative of the smoothed cumulative function. For example, in "R", the following code generates incident events from a homogeneous Poisson process and then smooths the rate function.
Code:
```N <- 100
x <- cumsum(rexp(N))
smooth_cumulative <- smooth.spline(x, 1:length(x), df=5)
rate_smooth <- predict(smooth_cumulative, 0 : (N-1)), deriv=1)
plot(rate_smooth, type="l", col="blue", lwd=2)```
You'll need to experiment with the degrees of freedom in the smoother.

If you tell me what software you are using, I'll see if I can identify the right command for you.

I was actually hoping I could just use excel with this task. I don't know how to use R. How do I calculate the culmulative incidence function from just the frequency?
4. (Original post by lunnndoner)
I was actually hoping I could just use excel with this task. I don't know how to use R. How do I calculate the culmulative incidence function from just the frequency?
Exactly what form do you have the data in? As far as I'm aware, the only built-in command in Excel for doing this is "exponential smoothing" which is in the Data Analysis toolpak.

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: April 13, 2016
Today on TSR

### Should I ask for his number?

Discussions on TSR

• Latest
• ## See more of what you like on The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

• Poll
Useful resources

### Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

### How to use LaTex

Writing equations the easy way

### Study habits of A* students

Top tips from students who have already aced their exams

## Groups associated with this forum:

View associated groups
Discussions on TSR

• Latest
• ## See more of what you like on The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

• The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE