Hi,
I'm trying to count the number of variables per person that have an ID ending in each integer.
i.e. 10 variables end in 1, 5 in 2, etc...
I have a variable for the final digit of the ID, AppInt
This line works to give the correct value per subgroup:
bysort examiner auy_numeric: count if AppInt==1
However when trying to generate a variable for this, the value given is just the total number of observations per person:
bysort examiner auy_numeric: egen Ones = count(AppInt==1)
Is there a simpler, less clunky way of doing this that actually works?
TIA.
I'm trying to count the number of variables per person that have an ID ending in each integer.
i.e. 10 variables end in 1, 5 in 2, etc...
I have a variable for the final digit of the ID, AppInt
This line works to give the correct value per subgroup:
bysort examiner auy_numeric: count if AppInt==1
However when trying to generate a variable for this, the value given is just the total number of observations per person:
bysort examiner auy_numeric: egen Ones = count(AppInt==1)
Is there a simpler, less clunky way of doing this that actually works?
TIA.
Comment