Hi,
I am new to Stata, so I am not very familiar with the codes. I have a dataset with multiple variables. For each subject, they have multiple visits. I am interested in people that showed a variable x score >0 at 2 time points a year apart. Because they have multiple visits, there are individuals who could show variable x score >0 at year 1, 2, 3, 4 OR at year 2,3 OR 2,4 . I want to track the first 2 time point that they scored >0 without dropping the other visits. How could I proceed with this?
An example of my data set:
patientID_all visit_num variable x ID_metcriteria
1 1 2 1
1 2 1 1
1 3 0
1 4 0
2 1 0
2 2 3 2
2 3 2 2
2 4 3
3 1 0
3 2 0
4 1 0
4 2 2
4 3 0
4 4 3
Apologies, if my question is a little confusing.
Related Posts with Generating a variable that tracks the first time 2 IDs appear simultaneously
Quadratic expression of Kuznets curveGood morning, I am trying to run a regression for a waste Kuznets curve (panel data). I used the qu…
Weighting regressionsHi, My regression involves forming skill groups from time series data and conducting a panel analys…
Stcox: testing model for baseline hazardI'm fitting a time-varying covariate model using the AG-model, where I'm assuming that the baseline …
Normality test*for large sample dataHi. I just joined statalist and ask the first question as a beginer. I'm worrying about duplicate q…
Normality test*for large sample dataHi. I just joined statalist and ask the first question as a beginer. I'm worrying about duplicate q…
Subscribe to:
Post Comments (Atom)
0 Response to Generating a variable that tracks the first time 2 IDs appear simultaneously
Post a Comment