Dear Statalist- Users!
I am working with Data from five waves of the Survey of Health, Ageing and Retirement in Europe (SHARE) and I would appreciate your help in regard to creating a dyadic data set.
Until now, I managed to merge all relevant questionnaires modules from the five waves into one big dataset and created an ID called "mergeid_n" to identify the respondents. In my case, respondents are european grandparents who reported in at least two waves, that they were providing grandchildcare and how often they did (daily, monthly, about every week, etc.). After merging the waves, I set the data to be a panel data set with the "xtset" command. Now I have a dataset in long format, showing me all the relevant variables I am interested in. To this point, everything went well. But here is my problem: some of the respondents did not only provide grandchild care to one, but to two or more kids in one observation/wave and gave information on how intens this grandchild care for each specific child was. These Information are stored in variables - e.g. sp015_1 indicates if grandchild care was provided to child1 [0 = no, 1 = yes], sp015_2 if it was provided to child 2, etc. (the same goes with grandchildcare intensity: sp016_1 = intensity of grandchild care provided to child 1, sp016_2 = intensity of grandchild care provided to child 2, and so on ...). Now I would like to make use of this information and create a dyadic data set. Just to make it clearer - until now I have a longitudinal dataset that looks like this:
wave mergeid_n sp016_1 sp016_2 sp016_3 ch005_1 (sex child1) ch005_2 (sex child 2) ...
1 5 daily monthly about every week male female
2 5 monthly . . male .
3 5 . daily . . female
4 5 daily daily daily male female
Now I would like to have a data set which looks like this:
wave mergeid_n intensity of grandchild care sex
1 5 sp016_1 ch005_1 (sex child1= male)
1 5 sp016_2 ch005_2 (sex child 2= female)
1 5 sp016_3
2 5
2 5
...
unfortunately I have no Idea how to get there, since I don't know how to expand a dataset that already is in long format for even more rows.
I really hope you understand my problem and can help to solve it!
Thank you for your answers!
Babette
I am working with Data from five waves of the Survey of Health, Ageing and Retirement in Europe (SHARE) and I would appreciate your help in regard to creating a dyadic data set.
Until now, I managed to merge all relevant questionnaires modules from the five waves into one big dataset and created an ID called "mergeid_n" to identify the respondents. In my case, respondents are european grandparents who reported in at least two waves, that they were providing grandchildcare and how often they did (daily, monthly, about every week, etc.). After merging the waves, I set the data to be a panel data set with the "xtset" command. Now I have a dataset in long format, showing me all the relevant variables I am interested in. To this point, everything went well. But here is my problem: some of the respondents did not only provide grandchild care to one, but to two or more kids in one observation/wave and gave information on how intens this grandchild care for each specific child was. These Information are stored in variables - e.g. sp015_1 indicates if grandchild care was provided to child1 [0 = no, 1 = yes], sp015_2 if it was provided to child 2, etc. (the same goes with grandchildcare intensity: sp016_1 = intensity of grandchild care provided to child 1, sp016_2 = intensity of grandchild care provided to child 2, and so on ...). Now I would like to make use of this information and create a dyadic data set. Just to make it clearer - until now I have a longitudinal dataset that looks like this:
wave mergeid_n sp016_1 sp016_2 sp016_3 ch005_1 (sex child1) ch005_2 (sex child 2) ...
1 5 daily monthly about every week male female
2 5 monthly . . male .
3 5 . daily . . female
4 5 daily daily daily male female
Now I would like to have a data set which looks like this:
wave mergeid_n intensity of grandchild care sex
1 5 sp016_1 ch005_1 (sex child1= male)
1 5 sp016_2 ch005_2 (sex child 2= female)
1 5 sp016_3
2 5
2 5
...
unfortunately I have no Idea how to get there, since I don't know how to expand a dataset that already is in long format for even more rows.
I really hope you understand my problem and can help to solve it!
Thank you for your answers!
Babette
Comment