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
Interaction Term with dummy and continuous variable!Hello all, I have a silly question regarding interaction term. Would appreciate prompt input :-) T…
Problems with the Esttab commandDear Stata community, I have currently an issue with the esttab command. I want to run a loop of re…
Xtabond2: Using the nolevel command when one variable is already differenced AND divided by a value from last period.Hey all, I am currently using xtabond2 for my small T large N panel data estimation. My variables …
Subjects with no failure event not in risk pool, StsetHello- I am using the following commands for my set of patients with multiple records and multiple …
Margins after xtlogit, feDear Statalist: I am trying to verify something about the -margins- command after xtlogit, fe. When…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with dropping observations in longitudinal study
Post a Comment