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
Conditioning on a string variableHi, I'm new to Stata and would like to know how to condition on a string variable. I have a variable…
Xtabond2 command for system GMM. Please help me with the coding!Dear all, I am studying the relationship between Economic growth and FDI inflow. Due to the endogen…
CRS Input-oriented Two-stage DEA ModelDear Statalist members, I have been trying to implement CRS Input-oriented Two-stage DEA Modelin my…
How to weight the analysis by the actual population?Dear Statalist, I hope you are well. In fact, I have used the method of random sampling to collect…
xtivreg2 interpretationDear all, Can I interpret the following output as the instruments are not valid by looking at the S…
Subscribe to:
Post Comments (Atom)
0 Response to Generating a variable that tracks the first time 2 IDs appear simultaneously
Post a Comment