I have a dataset where each observation/row is a person belonging to a certain family.
There is a variable "Family_ID" that for each member of the same family has the same number.
Moreover, there is variable "Age" and according to this one I have to create a new variable which for each family it counts the number of members aged 0-13 and assigns this number to each member of the family. I manually created the variable "Number0_13" to give you the idea of I'm trying to do.
How can I do this??
Thanks in advance for your help
Family_ID Age Number0_13
1 40 2
1 38 2
1 5 2
1 10 2
2 43 1
2 39 1
2 12 1
3 25 1
3 24 1
3 1 1