Hello everyone,

I am dealing with a somewhat complicated data that consists information about parents and their children. Therefore, questions about children are repeated 20 times assuming one respondent can have maximum of 20 children. So i have 20 columns for each children questions (e.g. 20 columns of child gender, 20 columns of child marital status, education, distance to parents etc.)

Since i cannot put 20 variables for gender, marital status, education etc. to my regression, I have to find a var to make these 20 variables into 1 variable. I was wondering if you can help me with this issue? How can i convert these variables into one? What can be the Stata command?

I am pasting an example of how my data look like. Thanks in advance for your help.
Best,

Martin

mergeid ch_gender_1 ch_gender_2 ch_gender_3 ch_gender_4
AT-000674-01 Male Male . .
AT-001215-01
AT-001492-01 Female Female Female Male
AT-001492-02 Female Female Female Male