Hi!
I'm working with data collected in 2002 (round 1), 2007 (round 2) and 2017 (round 3). I want to drop all the observations that participated in only one ofte the rounds, and only keep observations where the participant participated in two or three rounds.
I have a variable that indicates the reference number (ref_nr) of the participant. So in other words, if a person participated in both round 2 and 3, he or she will have the same reference number in both rounds.
I'm therefore wondering how I should write the command? I know the following commands doesn't work, but I'll write them as examples for you to understand what I'm after:
drop if ref_nr appear once
Or on the other side:
keep if ref_nr appear more than once
Thanks in advance!
Related Posts with Problem with dropping observations in longitudinal study
Mean, StDev, N, t-value in one commandHello Guys I have a dataset which shows the following: Firm date return DayofWeek AARGKB Janua…
Adding Independent Variables in RegressionHi there! I am new to Stata and am eager to learn. I am currently doing an OLS regression on a cros…
Converting a country-year dataset into a countyr-year-religiousgroup dataset (from wide format to long format)Hello, Thanks in advance for suggestions. I want to change the format of the data (I think the corre…
In regression analysis, is the unit of the predictor rounded in any way?In regression analysis, I'm familiar with the saying that the coefficient reported is an effect on y…
Zero-inflated models for binary variablesDear all, I am running multilevel regressions on a binary dependent variable characterised by a majo…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with dropping observations in longitudinal study
Post a Comment