Announcement

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

  • Random effect model - controlling for time

    Hy folks,

    i have the following panel data:

    ID Birthyear Year of Assessment Fahter played football Math Gender Age
    1 1980 1988 0 50 0 8
    1 1980 1990 0 55 0 10
    1 1980 1992 0 60 0 12
    2 1990 1998 1 70 0 8
    2 1990 2000 1 75 0 10
    2 1990 2002 1 80 0 12
    3 1985 1993 0 60 1 8
    ... ... ... ... ... ... ...

    and would like to know, whether the parental sporting activity is positively related to the childrens school performance. In the observed country, the rate of parents playing football increased a lot over time, as well as the math marks are increasing over the ages and year of assessments. So i was thinking using the following model

    xtset ID Birthyear
    xtreg Math fatherplayedfb gender, re

    The question raises, whether i should control for time, as the rate and marks are increasing?

    xtset ID Birthyear
    xtreg Math Fatherplayfb gender YearofAssessment, re

    or can you recommend any other suitbale model?

    thank you very much for your aprreciate adivce.

    best wishes

    Mathias

  • #2
    If you had actually tried what you are saying

    Code:
    . xtset id birthyear
    repeated time values within panel
    r(451);
    you would have already noticed that there is a problem, and the problem is that for each id, the birthyear is constant, or at least should be constant if you do not have data errors. We all get born only once, that is, everybody has only one birthdate.

    So probably what should be done here is

    Code:
    . xtset id yearofassessment
           panel variable:  id (unbalanced)
            time variable:  yearofasses~t, 1988 to 2002, but with gaps
                    delta:  1 unit
    And yes, you should include year fixed effects.

    Comment


    • #3
      thank you very much for your prompt advice. So you recommend:

      xtset id YEAROFASSESSMENT
      xtreg Math Fatherplayfb gender, YEAROFASSESSMENT age, re

      or is it wrong to use it twice in the "xtset" and "xtreg"?

      Best wishes

      Comment


      • #4
        Mathias:
        if you're interested in time fixed effect considering -YEAROFASSESSMENT- as a categorical variable, your code should become:
        Code:
        xtreg Math Fatherplayfb gender i.YEAROFASSESSMENT age, re
        Conversely, if you want to investigate the existence of turning point in -YEAROFASSESSMENT-, your code should become:
        Code:
        xtreg Math Fatherplayfb gender c.YEAROFASSESSMENT##c.YEAROFASSESSMENT age, re
        I cannot say whether or not you will find collinearity issues between -YEAROFASSESSMENT- and -age-.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X