Hey there! Sign in to join this conversationNew here? Join for free
    • Thread Starter
    Offline

    9
    ReputationRep:
    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.
    Offline

    13
    ReputationRep:
    (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.
    • Thread Starter
    Offline

    9
    ReputationRep:
    (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?
    Offline

    13
    ReputationRep:
    (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.
 
 
 
  • 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
    Has a teacher ever helped you cheat?
    Useful resources

    Make your revision easier

    Maths

    Maths Forum posting guidelines

    Not sure where to post? Read the updated guidelines here

    Equations

    How to use LaTex

    Writing equations the easy way

    Student revising

    Study habits of A* students

    Top tips from students who have already aced their exams

    Study Planner

    Create your own Study Planner

    Never miss a deadline again

    Polling station sign

    Thinking about a maths degree?

    Chat with other maths applicants

    Can you help? Study help unanswered threads

    Groups associated with this forum:

    View associated groups
  • 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

    Write a reply...
    Reply
    Hide
    Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.