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
Help with hetroskedasticity in time seriesHi! I am doing a project where I look for seasonalities in stock prices. E.g. we have created dummi…
Encode or sencode with specific reserved value labelsHi Statalist I am encoding a list of categorical variables that are common in four datafiles, one f…
Which method to use to see differences?Hello! I have four variable ‘education’, year 2000, year, 2005, and year 2010 Education year 2000 …
Import label from .csv fileHi, I have two files and i want to import my label from one to the other. Is here an automatic way …
Graph transparency with Stata14Hi all, I want to plot on the same graph the effect of a predictor for both conditional and uncondi…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with dropping observations in longitudinal study
Post a Comment