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
Patient Flow FrequenciesHi Everyone, I am working with a datset that has following variables: 1) mrn: unique identifier 2)…
Time-Invariant instrument variable and country fixed effects in pooled cross-sectional datasetI have following question; Can I use time-invariant instrumental variable while controlling for coun…
Can I use PPML to run a long-difference regression?Dear Statalisters, I want to know whether I can estimate a long-difference regression using PPML. …
Break , Exit or clear nothing is working on stata 17 maybe because of a complex codingCould anyone help me to find a solution if none of - break , exit or clear doesn't work on stata 17 …
Combination Name Across Unique IdentifiersHi Everyone, I am working with a datset that has following variables: 1) mrn: unique identifier 2)…
Subscribe to:
Post Comments (Atom)
0 Response to create v3 which shows number of v1 that share the same v2 value
Post a Comment