Announcement

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

  • Need help estimating changes in variables over time in panel regression

    Dear all,


    I have a longitudinal panel survey that collects data from around 40,000 individuals between 2010 and 2019.

    I want to bring out the time dimension in my data and calculate any changes in variables that occur over time. However, I am unsure how to do it. I also have a lot of time-invariant variables, such as their highest qualification achieved, sex assigned at birth, sector of employment etc.

    I would be very grateful if anyone knows a solution to this!

    The data example is included below:


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte(sex children age high_qual sector) float(time training_hrs wages edu_level training_level job_type) int _freq
    2 0 2 1 3 2010 0  6.899724 1 0 0 1
    1 0 2 1 . 2010 0         . 1 0 1 3
    2 0 2 1 . 2010 0         . 1 0 1 3
    2 0 2 1 . 2011 0         0 1 0 1 2
    1 0 2 1 . 2012 0         0 1 0 1 1
    2 0 2 1 . 2012 0         0 1 0 1 1
    2 0 2 1 5 2012 0  1.149954 1 0 0 1
    2 0 2 1 2 2012 0 15.799602 1 0 0 1
    1 0 2 1 . 2013 0         0 1 0 1 2
    2 0 2 1 2 2013 0         0 1 0 1 1
    1 . 2 1 . 2014 0         0 1 0 1 1
    1 0 2 1 5 2015 0 12.886477 1 0 0 1
    1 0 2 1 . 2016 0         . 1 0 1 1
    1 0 2 1 . 2017 0         0 1 0 1 1
    1 0 2 1 6 2017 0 3.3220255 1 0 0 1
    1 0 2 1 . 2019 0         0 1 0 1 2
    2 0 2 1 . 2019 0         0 1 0 1 1
    1 0 2 1 2 2019 0 33.220913 1 0 1 1
    1 0 3 1 5 2010 0  5.979761 1 0 0 1
    2 0 3 1 3 2010 0  9.583141 1 0 0 1
    1 0 3 1 . 2010 0         . 1 0 1 1
    2 0 3 1 . 2010 0         . 1 0 1 4
    2 1 3 1 . 2010 0         . 1 0 1 1
    1 0 3 1 . 2011 0         0 1 0 1 1
    2 1 3 1 2 2011 0         0 1 0 1 1
    2 . 3 1 . 2011 0         0 1 0 1 1
    1 0 3 1 . 2011 0  5.182429 1 0 0 1
    2 0 3 1 3 2011 0  8.624655 1 0 0 1
    2 0 3 1 3 2011 0  9.199632 1 0 0 1
    1 0 3 1 . 2012 0         0 1 0 1 2
    1 . 3 1 . 2012 0         0 1 0 1 3
    2 0 3 1 . 2012 0         0 1 0 1 1
    1 0 3 1 3 2012 0  6.604022 1 0 0 1
    2 0 3 1 3 2012 0  8.213957 1 0 0 1
    2 0 3 1 5 2012 0  8.720447 1 0 0 1
    1 0 3 1 . 2013 0         0 1 0 1 2
    1 . 3 1 . 2013 0         0 1 0 1 1
    2 0 3 1 . 2013 0         0 1 0 1 4
    2 . 3 1 5 2013 0         0 1 0 1 1
    1 0 3 1 6 2013 0 1.4374425 1 0 0 1
    2 0 3 1 5 2013 0 1.7888173 1 0 0 1
    2 0 3 1 5 2013 0 4.0887256 1 0 1 1
    1 0 3 1 5 2013 0  4.429495 1 0 0 1
    2 0 3 1 4 2013 0  4.456072 1 0 1 1
    2 0 3 1 3 2013 0  6.976426 1 0 0 1
    1 0 3 1 . 2014 0         0 1 0 1 4
    2 0 3 1 . 2014 0         0 1 0 1 5
    2 . 3 1 . 2014 0         0 1 0 1 1
    2 0 3 1 5 2014 0   5.74977 1 0 0 1
    1 0 3 1 5 2014 0  6.859753 1 0 0 1
    1 0 3 1 . 2015 0         0 1 0 1 1
    1 . 3 1 . 2015 0         0 1 0 1 1
    2 0 3 1 . 2015 0         0 1 0 1 1
    2 0 3 1 5 2015 0  5.315206 1 0 1 1
    2 0 3 1 3 2015 0  6.955667 1 0 1 1
    1 0 3 1 5 2015 0   8.30516 1 0 0 1
    2 0 3 1 2 2015 0 22.922436 1 0 1 1
    1 0 3 1 . 2016 0         . 1 0 1 3
    1 0 3 1 . 2017 0         0 1 0 1 2
    2 0 3 1 5 2017 0 4.3123274 1 0 0 1
    1 0 3 1 4 2017 0  4.983112 1 0 1 1
    1 0 3 1 5 2017 0  9.358153 1 0 1 1
    2 0 3 1 3 2017 0 11.336535 1 0 0 1
    1 0 3 1 . 2018 0         0 1 0 1 2
    2 0 3 1 . 2019 0         0 1 0 1 3
    1 0 3 1 . 2019 0  4.983243 1 0 0 1
    1 0 3 1 6 2019 0  6.168545 1 0 1 1
    1 0 3 1 3 2019 0  6.661108 1 0 0 1
    2 0 3 1 5 2019 0  9.966191 1 0 0 1
    1 0 3 1 5 2019 0  11.86205 1 0 0 1
    1 0 3 1 5 2019 0 14.925253 1 0 0 1
    1 0 4 1 5 2010 0 1.2156657 1 0 1 1
    2 0 4 1 5 2010 0 1.9932842 1 0 0 1
    1 0 4 1 4 2010 0 2.3729026 1 0 1 1
    2 0 4 1 5 2010 0  2.723575 1 0 0 1
    1 0 4 1 3 2010 0  2.874885 1 0 0 1
    1 0 4 1 3 2010 0  2.874885 1 0 1 1
    2 0 4 1 3 2010 0  3.017192 1 0 1 1
    2 0 4 1 2 2010 0  3.239018 1 0 1 1
    1 0 4 1 6 2010 0  3.488194 1 0 0 1
    1 0 4 1 2 2010 0  3.833165 1 0 1 1
    2 0 4 1 5 2010 0 4.1526756 1 0 0 1
    1 0 4 1 3 2010 0 4.3133626 1 0 1 1
    1 0 4 1 3 2010 0  4.599816 1 0 0 1
    2 0 4 1 3 2010 0  4.599816 1 0 0 2
    2 0 4 1 4 2010 0  4.599816 1 0 0 1
    2 1 4 1 2 2010 0  4.599816 1 0 0 1
    2 0 4 1 3 2010 0 4.6918125 1 0 0 1
    2 0 4 1 5 2010 0  4.796314 1 0 0 1
    2 0 4 1 3 2010 0  4.914314 1 0 1 1
    2 0 4 1 4 2010 0  4.983117 1 0 1 1
    1 0 4 1 3 2010 0  4.983119 1 0 1 1
    2 0 4 1 5 2010 0  4.983153 1 0 1 1
    1 0 4 1 5 2010 0  5.034294 1 0 1 1
    1 0 4 1 3 2010 0  5.174793 1 0 0 1
    1 0 4 1 5 2010 0  5.260017 1 0 0 1
    1 0 4 1 4 2010 0  5.339072 1 0 0 1
    1 0 4 1 3 2010 0  5.481417 1 0 0 1
    2 0 4 1 5 2010 0  5.481417 1 0 0 1
    1 0 4 1 5 2010 0  5.481428 1 0 1 1
    end
    label values sex b_sex
    label def b_sex 1 "male", modify
    label def b_sex 2 "female", modify
    label values children b_nchund18resp
    label values age b_agegr13_dv
    label def b_agegr13_dv 2 "16-17 years old", modify
    label def b_agegr13_dv 3 "18-19 years old", modify
    label def b_agegr13_dv 4 "20-24 years old", modify
    label values high_qual b_hiqual_dv
    label def b_hiqual_dv 1 "Degree", modify
    label values sector b_jbrgsc_dv
    label def b_jbrgsc_dv 2 "managerial & technical occupation", modify
    label def b_jbrgsc_dv 3 "skilled non-manual", modify
    label def b_jbrgsc_dv 4 "skilled manual", modify
    label def b_jbrgsc_dv 5 "partly skilled occupation", modify
    label def b_jbrgsc_dv 6 "unskilled occupation", modify
    label values edu_level low_high
    label values training_level low_high
    label def low_high 1 "High", modify
    label def low_high 0 "Low", modify
    label values job_type ptime_ftime
    label def ptime_ftime 0 "Part time", modify
    label def ptime_ftime 1 "Full time", modify



    Kind Regards,
    Guest
    Last edited by sladmin; 25 Apr 2022, 08:26. Reason: anonymize original poster

  • #2
    Guest:
    see -xtsum-.
    Last edited by sladmin; 25 Apr 2022, 08:27. Reason: anonymize original poster
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Dear Carlo Lazzaro,

      Thank you for your time and help. I have created a table using -xtsum- already. But is this sufficient to show observations by year plus any trends in variables of interest over time?

      Kind Regards,
      Guest
      Last edited by sladmin; 25 Apr 2022, 08:27. Reason: anonymize original poster

      Comment


      • #4
        Guest:
        -xtsum- gives back the within and between standard deciation of the variables included in your panel dataset.
        Please read related entry in Stata .pdf manual.
        If you have a different query, please be more detailed. Thanks.
        Last edited by sladmin; 25 Apr 2022, 08:27. Reason: anonymize original poster
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          thank you! Carlo Lazzaro

          Comment

          Working...
          X