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
How to avoid losing variable labels when using collapse commandI have smallholder agriculture plot level commercialization data which i want to collapse to househo…
Drawing a line through the outer XY combinations below the trend lineThe eventual goal is to assign minimum value of actl for a new exp value (where actl is missing). I …
Regular expression helpHello, Apologies for making a second regular expressions-related post today, but the topic is new t…
Identifying recession pointsHello, I have a dummy variable with 1 and -1: 1 corresponds to a peak, and -1 - to a trough. I want…
Command to obtain effect sizes.Hello, I am running two models on a panel data of 50 firms over 15 years (one using the xtnbreg and …
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