Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Regressing a time varying covariate, but limiting regression to a particular time period

    So my data looks something like the attached picture.

    My title is probably a bit ambiguous, so I will explain it in more detail here.

    My dependent variable is EVENT (Event=1 if the student graduated, 0 otherwise; not shown in the picture). Now I have a time-varying covariate called "Cumulative GPA", which shows, cumulatively, the GPA after each year. Now what I'd like to know is if I was interested in first-year GPA only, how would I go about running a regression which only included the first-year cumulative GPA? I'm intending to run a logit regression, as that seems to be the most suitable tool for discrete time survival analysis.

    Effectively, what I am trying to do is only include Cumulative GPA where _Period =1.
    Last edited by Chris Rooney; 02 May 2014, 07:00.

  • #2
    You mean you want to subset the data to period == 1 and then run a logit model? Why not just keep if period == 1?

    Comment


    • #3
      Originally posted by Dave Airey View Post
      You mean you want to subset the data to period == 1 and then run a logit model? Why not just keep if period == 1?
      I was thinking about that, but I have another time varying covariate (Residence Status). So for example, if someone graduated in 3 years, I'd like to know in each year whether they were in residence, but perhaps I'm only interested in yearly cumulative GPAs (1st year cumulative GPA, 2nd year cumulative GPA, 3rd cumulative GPA etc). If I only look at the subset period==1, I will have no-one graduating (as no-one can graduate in one-year for an undergraduate degree). I'd really like to know the effect of 1st-year GPA on graduation (as well as other variables, of course)

      Right now as it stands, I can't really determine which year the cumulative GPA refers to, besides manually looking at the Cumulative GPA and period variable together.

      Perhaps I will need to create separate dummy variables for each GPA year...

      Comment


      • #4
        It's hard I agree, but try to figure out all the questions you want from the data before you start modeling for sure. Maybe I'm being slow, but why could you not use first year GPA to predict graduation if the data are retrospective?
        Last edited by Dave Airey; 02 May 2014, 07:43.

        Comment


        • #5
          Originally posted by Dave Airey View Post
          It's hard I agree, but try to figure out all the questions you want from the data before you start modeling for sure. Maybe I'm being slow, but why could you not use first year GPA to predict graduation if the data are retrospective?
          That is what I am trying to do. However, my data just has a column ("Cumulative GPA"), with the first record for each student referring to first year, second record referring to second year cumulative GPA and so on. It's obvious (via manual inspection) which year the cumulative GPA refers to, but I'm trying to find a way where the GPA is linked to the academic year (1st, 2nd, 3rd, 4th). Right now, I suspect when I run a logit, Stata will hav CumulativeGPA as one variable, and I want to break it down into its components.

          I suppose a possible solution is to create several variables: "First Year GPA", "Second Year GPA" etc and then copy these values from the Cumulative GPA variable. However, I am not sure how to do that. Would you know how to do that? Basically for First Year GPA, I'd like to duplicate the value of CumulativeGPA if period==1?
          Last edited by Chris Rooney; 02 May 2014, 09:13.

          Comment


          • #6
            It's not entirely clear to me, but is Chris trying to (a) run his original time-to-event model but (b) using GPA in year 1 as covariate (rather than, or as well as, cumulative GPA each year)? If this conjecture is correct, then create a new covariate, say gpa1 which is constant in every year that each person is observed at risk of experiencing the event:
            Something like

            Code:
            bysort StudentID (_period): ge gpa1 = cum_gpa[1]
            where "cum_gpa" is the cumulative GPA variable, and "_period" is the year variable.

            Then use the new gpa1 variable in the time-to-event regression model. The ability to index observations, combined with by group operations, is one of Stata's fortes.

            Comment

            Working...
            X