Hi all,
I am still a novice at using Stata, and I would like to ask a question.
I have a panel data containing information about hospitals from years 2007 to 2016, and I would like to count the number of observations that have a change in value for a particular variable across the years. More specifically, I would like to count the number of hospitals that have changed ownership from public to private across the years.
My thought process is to first bys hospital_id, and then count the number of observations where private changes from 0 to 1 across the years.
However, I am not too sure what would be the command for this on Stata version 14.
Your inputs will be greatly appreciated. Thank you in advance.
Regards,
Priscilla
Related Posts with Count the number of observations that have a change in value for a particular variable across the years
Any way to recover a .do file after a crash?Stata crashed in the midst of a loop and I'm wondering if there is any way to recover the do file I …
Difficulty with reproducibility of results and autocorrelation estimates using mixedDear Stata users, I have been running simulation studies investigating interrupted time series stud…
Help needed creating & deleting observationsHi all, I have a database management problem that feels like it should be solvable, but I am just n…
Psmatch2 matched by firmHi all! I have a question about psmatch2. Now I am trying to use psmatch2 to generate untreated gro…
Can I use xthybrid with short panels, i.e. T <N ?Dear Collegues: Can I use xthybrid with short panels, i.e. T <N ? …
Subscribe to:
Post Comments (Atom)
0 Response to Count the number of observations that have a change in value for a particular variable across the years
Post a Comment