Announcement

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

  • Should I add age^2 when working with panel data or not?

    Hi all,

    I am analyzing the effect of marital status on life satisfaction for a period of 32 years of balance panel data with missing observations. I am controlling for log income, sex, age, educational level, employment level, region, kids in the family. I am wondering if I should add or not squared age into the regression or not.

    My arguments for are that age might me related to the dependent variable - life satisfaction. However, that is exactly the relationship I ant to analyze, how happiness changes with age for example. Life satisfaction is categorical variable running from 0 (not satisfied) to 10 (completely satisfied).

    At first step I did transform the variable into dummy 1 if reported levels over 7 and 0 otherwise. Then I did a 'utest' which showed that I should not be adding ages squared.

    xtlogit newlifesatis_ c.age age2, fe
    utest age age2, prefix(newlifesatis_)

    Further I did a 'vif' variance inflation factor test to check for multicollinearity and all variable came with coefficient smaller than 5. However, when running the regression with and without age squared I am getting a bit higher R-squared (0.26 compared to 0.2640) and the significance of the variables doesn't change.

    Below is the sample of my dataset. Please, advise if I am wrong. I don't want to bias my regression.

    Kind regards,
    Gabriela


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte(lifesatis marstatus newd11105) float(log_HH_income log_educ) int age float age2 byte(region sathealth empl_level) int syear
     8 1 1 10.289362   2.70805 54 2916 1  8 1 1984
     8 1 1  9.700759   2.70805 55 3025 1  8 1 1985
    10 1 1 10.054663   2.70805 56 3136 1  7 1 1986
     8 1 1  8.497194   2.70805 57 3249 1  5 1 1987
     8 1 1  9.633514   2.70805 58 3364 1  8 1 1988
     8 1 1  9.845593   2.70805 59 3481 1  7 1 1989
     . . .         .         .  .    . .  . . 1990
     . . .         .         .  .    . .  . . 1991
     . . .         .         .  .    . .  . . 1992
     . . .         .         .  .    . .  . . 1993
     . . .         .         .  .    . .  . . 1994
     . . .         .         .  .    . .  . . 1995
     . . .         .         .  .    . .  . . 1996
     . . .         .         .  .    . .  . . 1997
     . . .         .         .  .    . .  . . 1998
     . . .         .         .  .    . .  . . 1999
     . . .         .         .  .    . .  . . 2000
     . . .         .         .  .    . .  . . 2001
     . . .         .         .  .    . .  . . 2002
     . . .         .         .  .    . .  . . 2003
     . . .         .         .  .    . .  . . 2004
     . . .         .         .  .    . .  . . 2005
     . . .         .         .  .    . .  . . 2006
     . . .         .         .  .    . .  . . 2007
     . . .         .         .  .    . .  . . 2008
     . . .         .         .  .    . .  . . 2009
     . . .         .         .  .    . .  . . 2010
     . . .         .         .  .    . .  . . 2011
     . . .         .         .  .    . .  . . 2012
     . . .         .         .  .    . .  . . 2013
     . . .         .         .  .    . .  . . 2014
     . . .         .         .  .    . .  . . 2015
     8 1 1 10.289362 2.1972246 44 1936 1  7 3 1984
     8 1 1  9.700759 2.1972246 45 2025 1  8 3 1985
     9 1 1 10.054663 2.1972246 46 2116 1  7 3 1986
     8 1 1  8.497194 2.1972246 47 2209 1  8 3 1987
     9 1 1  9.633514 2.1972246 48 2304 1  8 3 1988
    10 1 1  9.845593 2.1972246 49 2401 1 10 3 1989
     . . .         .         .  .    . .  . . 1990
     . . .         .         .  .    . .  . . 1991
     . . .         .         .  .    . .  . . 1992
     . . .         .         .  .    . .  . . 1993
     . . .         .         .  .    . .  . . 1994
     . . .         .         .  .    . .  . . 1995
     . . .         .         .  .    . .  . . 1996
     . . .         .         .  .    . .  . . 1997
     . . .         .         .  .    . .  . . 1998
     . . .         .         .  .    . .  . . 1999
     . . .         .         .  .    . .  . . 2000
     . . .         .         .  .    . .  . . 2001
     . . .         .         .  .    . .  . . 2002
     . . .         .         .  .    . .  . . 2003
     . . .         .         .  .    . .  . . 2004
     . . .         .         .  .    . .  . . 2005
     . . .         .         .  .    . .  . . 2006
     . . .         .         .  .    . .  . . 2007
     . . .         .         .  .    . .  . . 2008
     . . .         .         .  .    . .  . . 2009
     . . .         .         .  .    . .  . . 2010
     . . .         .         .  .    . .  . . 2011
     . . .         .         .  .    . .  . . 2012
     . . .         .         .  .    . .  . . 2013
     . . .         .         .  .    . .  . . 2014
     . . .         .         .  .    . .  . . 2015
     8 2 3 10.289362  2.484907 21  441 1  8 1 1984
     8 2 1   9.89278  2.484907 22  484 1 10 1 1985
     7 2 1  9.326166  2.484907 23  529 1  9 1 1986
     7 2 1  10.35974  2.484907 24  576 1 10 1 1987
     . . .         .         .  .    . .  . . 1988
     . . .         .         .  .    . .  . . 1989
     . . .         .         .  .    . .  . . 1990
     . . .         .         .  .    . .  . . 1991
     . . .         .         .  .    . .  . . 1992
     . . .         .         .  .    . .  . . 1993
     . . .         .         .  .    . .  . . 1994
     . . .         .         .  .    . .  . . 1995
     . . .         .         .  .    . .  . . 1996
     . . .         .         .  .    . .  . . 1997
     . . .         .         .  .    . .  . . 1998
     . . .         .         .  .    . .  . . 1999
     . . .         .         .  .    . .  . . 2000
     . . .         .         .  .    . .  . . 2001
     . . .         .         .  .    . .  . . 2002
     . . .         .         .  .    . .  . . 2003
     . . .         .         .  .    . .  . . 2004
     . . .         .         .  .    . .  . . 2005
     . . .         .         .  .    . .  . . 2006
     . . .         .         .  .    . .  . . 2007
     . . .         .         .  .    . .  . . 2008
     . . .         .         .  .    . .  . . 2009
     . . .         .         .  .    . .  . . 2010
     . . .         .         .  .    . .  . . 2011
     . . .         .         .  .    . .  . . 2012
     . . .         .         .  .    . .  . . 2013
     . . .         .         .  .    . .  . . 2014
     . . .         .         .  .    . .  . . 2015
    10 . 1   7.90802  2.397895 58 3364 1 10 3 1984
    10 . 1  7.805475  2.397895 59 3481 1  5 3 1985
     9 . 1  8.028781  2.397895 60 3600 1  9 3 1986
    10 . 1         .  2.397895 61 3721 1 10 3 1987
    end
    label values lifesatis p11101
    label def p11101 10 "[10] Completely satisfied    10", modify
    label values marstatus d11104
    label def d11104 1 "[1] Married        1", modify
    label def d11104 2 "[2] Single         2", modify
    label values region l11102
    label def l11102 1 "[1] West-Germany   1", modify
    label values sathealth m11125
    label def m11125 10 "[10] Completely satisfied    10", modify
    label values empl_level e11103
    label def e11103 1 "[1] Full Time      1", modify
    label def e11103 3 "[3] Not Working    3", modify


  • #2
    Gabriela:
    please check your data excerpt, as it does not allow to run the regression code you typed (and, at the top of that, there's only one -id- and the regressand is not included).
    As an aside, please note that squared terms are far better created via -fvvarlist- (due to its straight relationships with -margins- and -marginsplot-) than by hand.
    Eventually, please note that, for sound theoretical reasons (see Tony Lancaster's paper at http://www.econ.brown.edu/Faculty/To...meters1948.pdf) your specification focuses on conditional fixed effect (not fixed effect).
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo,

      I believe I missed the dummy variable for life satisfaction. I am ware I need to do conditional regression but I never reach out any output when doing FE conditional. I did this with OLS and Ordered legit OLS and compared the partial coefficients (1:1.18 OLS compared to 1:1.24 Conditional OLS) and said that the difference is not so big hence for easy in analysis of the coefficients I will be using OLS.

      Kind regards,
      Gabriela

      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input byte(newlifesatis_ lifesatis marstatus sex newd11105) float(log_HH_income log_educ) int age byte(ppl_HH children_HH region sathealth empl_level) int syear
      1  8 1 1 1 10.289362   2.70805 54 3 0 1  8 1 1984
      1  8 1 1 1  9.700759   2.70805 55 2 0 1  8 1 1985
      1 10 1 1 1 10.054663   2.70805 56 2 0 1  7 1 1986
      1  8 1 1 1  8.497194   2.70805 57 2 0 1  5 1 1987
      1  8 1 1 1  9.633514   2.70805 58 2 0 1  8 1 1988
      1  8 1 1 1  9.845593   2.70805 59 2 0 1  7 1 1989
      .  . . . .         .         .  . . . .  . . 1990
      .  . . . .         .         .  . . . .  . . 1991
      .  . . . .         .         .  . . . .  . . 1992
      .  . . . .         .         .  . . . .  . . 1993
      .  . . . .         .         .  . . . .  . . 1994
      .  . . . .         .         .  . . . .  . . 1995
      .  . . . .         .         .  . . . .  . . 1996
      .  . . . .         .         .  . . . .  . . 1997
      .  . . . .         .         .  . . . .  . . 1998
      .  . . . .         .         .  . . . .  . . 1999
      .  . . . .         .         .  . . . .  . . 2000
      .  . . . .         .         .  . . . .  . . 2001
      .  . . . .         .         .  . . . .  . . 2002
      .  . . . .         .         .  . . . .  . . 2003
      .  . . . .         .         .  . . . .  . . 2004
      .  . . . .         .         .  . . . .  . . 2005
      .  . . . .         .         .  . . . .  . . 2006
      .  . . . .         .         .  . . . .  . . 2007
      .  . . . .         .         .  . . . .  . . 2008
      .  . . . .         .         .  . . . .  . . 2009
      .  . . . .         .         .  . . . .  . . 2010
      .  . . . .         .         .  . . . .  . . 2011
      .  . . . .         .         .  . . . .  . . 2012
      .  . . . .         .         .  . . . .  . . 2013
      .  . . . .         .         .  . . . .  . . 2014
      .  . . . .         .         .  . . . .  . . 2015
      1  8 1 2 1 10.289362 2.1972246 44 3 0 1  7 3 1984
      1  8 1 2 1  9.700759 2.1972246 45 2 0 1  8 3 1985
      1  9 1 2 1 10.054663 2.1972246 46 2 0 1  7 3 1986
      1  8 1 2 1  8.497194 2.1972246 47 2 0 1  8 3 1987
      1  9 1 2 1  9.633514 2.1972246 48 2 0 1  8 3 1988
      1 10 1 2 1  9.845593 2.1972246 49 2 0 1 10 3 1989
      .  . . . .         .         .  . . . .  . . 1990
      .  . . . .         .         .  . . . .  . . 1991
      .  . . . .         .         .  . . . .  . . 1992
      .  . . . .         .         .  . . . .  . . 1993
      .  . . . .         .         .  . . . .  . . 1994
      .  . . . .         .         .  . . . .  . . 1995
      .  . . . .         .         .  . . . .  . . 1996
      .  . . . .         .         .  . . . .  . . 1997
      .  . . . .         .         .  . . . .  . . 1998
      .  . . . .         .         .  . . . .  . . 1999
      .  . . . .         .         .  . . . .  . . 2000
      .  . . . .         .         .  . . . .  . . 2001
      .  . . . .         .         .  . . . .  . . 2002
      .  . . . .         .         .  . . . .  . . 2003
      .  . . . .         .         .  . . . .  . . 2004
      .  . . . .         .         .  . . . .  . . 2005
      .  . . . .         .         .  . . . .  . . 2006
      .  . . . .         .         .  . . . .  . . 2007
      .  . . . .         .         .  . . . .  . . 2008
      .  . . . .         .         .  . . . .  . . 2009
      .  . . . .         .         .  . . . .  . . 2010
      .  . . . .         .         .  . . . .  . . 2011
      .  . . . .         .         .  . . . .  . . 2012
      .  . . . .         .         .  . . . .  . . 2013
      .  . . . .         .         .  . . . .  . . 2014
      .  . . . .         .         .  . . . .  . . 2015
      1  8 2 1 3 10.289362  2.484907 21 3 0 1  8 1 1984
      1  8 2 1 1   9.89278  2.484907 22 1 0 1 10 1 1985
      1  7 2 1 1  9.326166  2.484907 23 1 0 1  9 1 1986
      1  7 2 1 1  10.35974  2.484907 24 2 0 1 10 1 1987
      .  . . . .         .         .  . . . .  . . 1988
      .  . . . .         .         .  . . . .  . . 1989
      .  . . . .         .         .  . . . .  . . 1990
      .  . . . .         .         .  . . . .  . . 1991
      .  . . . .         .         .  . . . .  . . 1992
      .  . . . .         .         .  . . . .  . . 1993
      .  . . . .         .         .  . . . .  . . 1994
      .  . . . .         .         .  . . . .  . . 1995
      .  . . . .         .         .  . . . .  . . 1996
      .  . . . .         .         .  . . . .  . . 1997
      .  . . . .         .         .  . . . .  . . 1998
      .  . . . .         .         .  . . . .  . . 1999
      .  . . . .         .         .  . . . .  . . 2000
      .  . . . .         .         .  . . . .  . . 2001
      .  . . . .         .         .  . . . .  . . 2002
      .  . . . .         .         .  . . . .  . . 2003
      .  . . . .         .         .  . . . .  . . 2004
      .  . . . .         .         .  . . . .  . . 2005
      .  . . . .         .         .  . . . .  . . 2006
      .  . . . .         .         .  . . . .  . . 2007
      .  . . . .         .         .  . . . .  . . 2008
      .  . . . .         .         .  . . . .  . . 2009
      .  . . . .         .         .  . . . .  . . 2010
      .  . . . .         .         .  . . . .  . . 2011
      .  . . . .         .         .  . . . .  . . 2012
      .  . . . .         .         .  . . . .  . . 2013
      .  . . . .         .         .  . . . .  . . 2014
      .  . . . .         .         .  . . . .  . . 2015
      1 10 . 2 1   7.90802  2.397895 58 3 0 1 10 3 1984
      1 10 . 2 1  7.805475  2.397895 59 2 0 1  5 3 1985
      1  9 . 2 1  8.028781  2.397895 60 2 0 1  9 3 1986
      1 10 . 2 1         .  2.397895 61 1 0 1 10 3 1987
      end
      label values lifesatis p11101
      label def p11101 10 "[10] Completely satisfied    10", modify
      label values marstatus d11104
      label def d11104 1 "[1] Married        1", modify
      label def d11104 2 "[2] Single         2", modify
      label values sex d11102ll
      label def d11102ll 1 "[1] Male           1", modify
      label def d11102ll 2 "[2] Female         2", modify
      label values region l11102
      label def l11102 1 "[1] West-Germany   1", modify
      label values sathealth m11125
      label def m11125 10 "[10] Completely satisfied    10", modify
      label values empl_level e11103
      label def e11103 1 "[1] Full Time      1", modify
      label def e11103 3 "[3] Not Working    3", modify

      Comment


      • #4
        Gabriela:
        - actually, the -fe- estimator wipes out any time-invariant variable: hence, your result is not surprising at all;
        - besides, your outcome does not seem to vary as time goes by; hence, -re- specification is untestable on your data example;
        - I woud not sponsor your approach of using OLS if you have an ordered regressand.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Dear Carlo,

          thank you. Point taken.

          Kind regards,
          Gabriella

          Comment

          Working...
          X