Good day everyone. I am fairly new to Stata and i have a problem working with Longitudinal data. My data looks as follows
I wish to get the first differences wave5- wave1 for each variable so i can compare changes over time for each pid. I am guessing I have to use a loop but some direction will be of great help.
Thank you
Code:
pid wave age bmi 301012 1 66 27.5 301012 5 75 27.2 301013 1 26 21.5 301013 5 35 17.6 301015 1 46 37.4 301015 5 55 . 301016 1 28 . 301016 5 37 . 301017 1 31 . 301017 5 . . 301018 1 52 41.3 301018 5 62 . 301019 1 25 . 301019 5 35 . 301025 1 46 . 301025 5 55 .
I wish to get the first differences wave5- wave1 for each variable so i can compare changes over time for each pid. I am guessing I have to use a loop but some direction will be of great help.
Thank you
Comment