My dataset comes from a survey with 5 waves that has a general score (variable GScore). I am trying to do the following:
1) I am trying to generate a new variables that shows the General Score increase from each wave to the next (so that a decrease in scores will be a negative value). What code would work best for this? I am currently trying to use the following unsuccessfully:
bysort id: gen GScore_increase = GScore - GScore[_n-1]
2) What code would calculate the overall mean increase (or potential decrease) in the GScore across all waves for all participants?
3) Is there an efficient code I could use to determine how many participants decreased or maintained the same GScore across all waves (i.e. how many never increased their Gscore across all the waves)?
Related Posts with Generating Variable That Depicts Increase
Transfer post hoc data into wordHow can be able to transfer post hoc results in word from STATA? Any view? …
Calculating standard deviations from wtp commandHi all I am needing to calculate the standard deviations from my wtp estimates. I have used the wtp…
Testing multiple coefficients equal to 1 with testHi all. I am running a panel regression with over 60 dummy variable coefficients that I'd like to te…
Treatment of missings in geodistI have encountered the following issue using geodist from SSC, by Robert Picard: When all coordinate…
Error message when introducing factor variables in stcox on imputed dataDear Statalist, I'm running stcox on multiply imputed data. I have used the same model and syntax o…
Subscribe to:
Post Comments (Atom)
0 Response to Generating Variable That Depicts Increase
Post a Comment