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
Dynamic binary panel models with endogeneityHi all, I have a question related to dynamic panel analysis. As we know, xtabond2 is suitable to u…
Testing coefficients or predictions with > 500,000 unit fixed effectsPROBLEM: I am examining how mobility fell during a COVID lockdown in two types of communities, slum…
Concentration Index with Grouped IncomeHi all, I am trying to implement the overall correction for unequal income group stated in Clarke, …
Dataset merging to maximize number of observationsHi, I would like to merge two datasets. Both datasets have the following columns: Year Gvkey Cusip …
Sorting VariablesHi I need to create a certain variable by sorting other variables, but I am not sure how to sort t…
Subscribe to:
Post Comments (Atom)
0 Response to Generating a variable that tracks the first time 2 IDs appear simultaneously
Post a Comment