Dear all,
This might be a trivial question, however, I am posting as I have searched multiple stata help pdfs without a relevant answer.
I am looking at a set of longitudinal data, whereby individuals have multiple values i.e
id value time
1 50 100
1 60 140
1 70 200
2 30 115
2 35 150
3 45 170
3 50 200
I am looking to categorize them into groups of >= 50 vs < 50.
However given the multiple values per indvidual, I would have
Is there a way to group them into my 2 groups of >=50 and < 50, while counting the number of distinct ids?
i.e for the dataset above, there would be 3 individuals instead of 7 observations.
Thanks for any help provided
Related Posts with Grouping multiple entries for a distinct id in longitudinal data
Converting continuous variable into categoricalHi, I am new to STATA and would really appreciate if someone could advise me on the following: I wou…
Random seed neededI am looking for a number or string that will be different in different runs of the same program. So…
Can we determine the significance of changes over time using cross-sectional data?Dear Statalisters, I am using data from the 2011 and 2014 Demographic Health Surveys (these are rep…
Interpretation of logit coefficients and rescaling of variablesDear all, I am trying interpret the coefficient of logistic regression results and would very much …
Convert string variable to a date variableDear Stata Users I have a string variable yearmonth: for Jan 2004 it's stored as "200401". I need t…
Subscribe to:
Post Comments (Atom)
0 Response to Grouping multiple entries for a distinct id in longitudinal data
Post a Comment