Hi,
My dataset has 2 variables that I am interested in seeing the relationship between.
v1 is 'unique_attend' which creates a unique code for each attendance (regardless of how many occur on the same day, or years apart etc.)
v2 is 'ID' which creates a unique ID number that is assigned to an individual.
Thus if there are 5 'unique_attend' cases with the same 'ID', that person has attended 5 times.
I want to create a third variable 'num_attend' which would show how many attendances are associated with each ID, but I can't for the life of me think of how to write that condition, and haven't been able to yield anything through searching.
Thanks in advance for the help,
Jane.
Related Posts with create v3 which shows number of v1 that share the same v2 value
How are cut points calculate in ordered logistic regression?Is there a formula available for how Stata calculates the cut points in ordered logistic regression …
How can i plot estimates of 3 different models (and each model has multiple estimates for time observations)?Hi everyone. I'm running 3 foreach loops to estimate 3 different models (they share some coefficient…
Reversing scale for variables like life expectancy, enrollment ratesHello wonderful Stata helpers, I know this is less Stata-specific and more conceptual, but I would a…
winsor or truncate variable into a dummy variableGreetings everyone, is there any way I can use stata to get variables are winsorized so that the la…
Interacting with stata temporary variables within mata functionsI am attempting to pass a value within a mata function to a stata temporary variable in an ado file.…
Subscribe to:
Post Comments (Atom)
0 Response to create v3 which shows number of v1 that share the same v2 value
Post a Comment