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
Stata 15 graph editor - strange behaviour on recordingGood afternoon! I would like to know if some of you experimented the same bug as me about graph edi…
Problem with data cleaning some variablesHi Stata Forum, This post died in the forum about some days ago, so here's again. I am having a pro…
Instrumental variable Probit regression using the cmp commandHi everyone, I want to investigate the effect that Financial Knowledge (FK, mesaured as the number …
only keep observations used in lagged regressionHello, I want to perform xtreg, fe on a panel dataset with lagged independent variables (1, 2 and 3…
Regression Discontinuity validity issuesI have tried to do a regression discontinuity design on my data for my dissertation. I am trying to …
Subscribe to:
Post Comments (Atom)
0 Response to create v3 which shows number of v1 that share the same v2 value
Post a Comment