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
Interaction Terms/Effects in Stata RegressionsGood evening, I have to calculate the interaction effect of my dummy variables P1-P3 on the market …
country pair fixed effects in gravity modelCan country pair fixed effects be used to address endogeneity in the case where the endogenous covar…
Create Output table with multiple variablesHi Everyone! New here and to STATA. Am done with the data cleaning and analysis (yay!), however woul…
Multiple line plot of long dataHello all, I’m working with a dataset in the long format. My observations are grouped within ids (i…
Remove leading "0"Dear all, I have observations entries that look like this: Array I'd like to remove the leading "…
Subscribe to:
Post Comments (Atom)
0 Response to create v3 which shows number of v1 that share the same v2 value
Post a Comment