You are Here: Home >< Maths

# Is there any other way to plot frequency data?

Announcements Posted on
TSR's new app is coming! Sign up here to try it first >> 17-10-2016
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.

## Register

Thanks for posting! You just need to create an account in order to submit the post
1. this can't be left blank
2. this can't be left blank
3. this can't be left blank

6 characters or longer with both numbers and letters is safer

4. this can't be left empty
1. Oops, you need to agree to our Ts&Cs to register

Updated: April 13, 2016
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:
Today on TSR

### How does exam reform affect you?

From GCSE to A level, it's all changing

Poll
Useful resources

### Maths Forum posting guidelines

Not sure where to post? Read here first

### How to use LaTex

Writing equations the easy way

### Study habits of A* students

Top tips from students who have already aced their exams