Hi,
I have household survey data for different countries and years and need to run DID to look at whether there's a change in child marriage before and after a law change. To do this, I am trying to create a retrospective panel that shows each woman's year of their life (e.g. from 0 to 100) so that I can see where in their life they were married for specific groups and only include these in my analysis. And then I will run the DID regressions.
Here is an example of my data - I have other variables in my dataset but I have not included them as I thought these are the most relevant to make the retrospective panel. I've included 2 different id variables as I'm not sure which one is the right one to use. idhspid is a unique cross-sample respondent identifier; caseid is a sample-specific respondent identifier
I have household survey data for different countries and years and need to run DID to look at whether there's a change in child marriage before and after a law change. To do this, I am trying to create a retrospective panel that shows each woman's year of their life (e.g. from 0 to 100) so that I can see where in their life they were married for specific groups and only include these in my analysis. And then I will run the DID regressions.
Here is an example of my data - I have other variables in my dataset but I have not included them as I thought these are the most relevant to make the retrospective panel. I've included 2 different id variables as I'm not sure which one is the right one to use. idhspid is a unique cross-sample respondent identifier; caseid is a sample-specific respondent identifier
Code:
input int(country year) str23 idhspid str18 caseid byte(age agefrstmar) 204 2006 "20403 1 1 2" "1 1 2" 28 12 204 2006 "20403 1 2 2" "1 2 2" 25 11 204 2006 "20403 1 3 3" "1 3 3" 25 14 204 2006 "20403 1 3 12" "1 3 12" 19 17 204 2006 "20403 1 5 2" "1 5 2" 18 12 204 2006 "20403 1 5 6" "1 5 6" 19 10 204 2006 "20403 1 6 6" "1 6 6" 20 11 204 2006 "20403 1 9 8" "1 9 8" 20 14 204 2006 "20403 1 10 2" "1 10 2" 30 17 204 2006 "20403 1 11 2" "1 11 2" 38 24 204 2006 "20403 1 12 2" "1 12 2" 45 16 204 2006 "20403 1 12 4" "1 12 4" 20 19 204 2006 "20403 1 13 2" "1 13 2" 45 32 204 2006 "20403 1 13 4" "1 13 4" 27 13 204 2006 "20403 1 14 2" "1 14 2" 20 11 204 2006 "20403 1 14 5" "1 14 5" 25 12 204 2006 "20403 1 14 10" "1 14 10" 18 16 204 2006 "20403 1 15 3" "1 15 3" 32 16 204 2006 "20403 1 15 5" "1 15 5" 19 15 204 2006 "20403 1 17 2" "1 17 2" 18 12 204 2006 "20403 1 19 2" "1 19 2" 29 12 204 2006 "20403 1 20 2" "1 20 2" 40 23 204 2006 "20403 1 21 3" "1 21 3" 16 12 204 2006 "20403 1 22 4" "1 22 4" 35 11 204 2006 "20403 1 23 5" "1 23 5" 27 15 204 2006 "20403 2 1 2" "2 1 2" 21 15 204 2006 "20403 2 2 2" "2 2 2" 45 16 204 2006 "20403 2 3 1" "2 3 1" 35 11 204 2006 "20403 2 4 2" "2 4 2" 20 14 204 2006 "20403 2 5 2" "2 5 2" 21 13 204 2006 "20403 2 7 2" "2 7 2" 25 19 204 2006 "20403 2 8 2" "2 8 2" 45 37 204 2006 "20403 2 10 7" "2 10 7" 29 14 204 2006 "20403 2 11 2" "2 11 2" 20 15 204 2006 "20403 2 12 2" "2 12 2" 19 13 204 2006 "20403 2 14 3" "2 14 3" 25 23 204 2006 "20403 2 15 1" "2 15 1" 30 21 204 2006 "20403 2 16 2" "2 16 2" 28 16 204 2006 "20403 2 17 2" "2 17 2" 25 16 204 2006 "20403 2 18 2" "2 18 2" 30 17 204 2006 "20403 2 22 2" "2 22 2" 45 26 204 2006 "20403 2 23 2" "2 23 2" 25 23 204 2006 "20403 3 1 2" "3 1 2" 19 13 204 2006 "20403 3 1 3" "3 1 3" 15 10 204 2006 "20403 3 2 4" "3 2 4" 25 15 204 2006 "20403 3 2 13" "3 2 13" 20 16 204 2006 "20403 3 2 15" "3 2 15" 18 10 204 2006 "20403 3 3 2" "3 3 2" 25 19 204 2006 "20403 3 4 2" "3 4 2" 19 15 204 2006 "20403 3 5 2" "3 5 2" 18 18 204 2006 "20403 3 6 7" "3 6 7" 45 26 204 2006 "20403 3 7 7" "3 7 7" 30 19 204 2006 "20403 3 8 2" "3 8 2" 48 20 204 2006 "20403 3 8 7" "3 8 7" 40 17 204 2006 "20403 3 9 2" "3 9 2" 35 14 204 2006 "20403 3 10 2" "3 10 2" 24 20 204 2006 "20403 3 11 2" "3 11 2" 25 16 204 2006 "20403 3 11 6" "3 11 6" 23 20 204 2006 "20403 3 12 2" "3 12 2" 20 15 204 2006 "20403 3 14 10" "3 14 10" 22 12 204 2006 "20403 3 14 13" "3 14 13" 15 11 204 2006 "20403 3 15 2" "3 15 2" 48 13 204 2006 "20403 3 18 2" "3 18 2" 22 15 204 2006 "20403 3 18 6" "3 18 6" 18 14 204 2006 "20403 3 19 2" "3 19 2" 35 12 204 2006 "20403 4 2 2" "4 2 2" 27 15 204 2006 "20403 4 3 2" "4 3 2" 37 15 204 2006 "20403 4 6 3" "4 6 3" 17 15 204 2006 "20403 4 7 2" "4 7 2" 27 14 204 2006 "20403 4 8 2" "4 8 2" 20 16 204 2006 "20403 4 10 2" "4 10 2" 30 21 204 2006 "20403 4 11 2" "4 11 2" 27 14 204 2006 "20403 4 11 6" "4 11 6" 25 20 204 2006 "20403 4 12 2" "4 12 2" 19 13 204 2006 "20403 4 13 2" "4 13 2" 26 21 204 2006 "20403 4 14 2" "4 14 2" 49 19 204 2006 "20403 4 15 2" "4 15 2" 30 12 204 2006 "20403 4 16 1" "4 16 1" 45 36 204 2006 "20403 4 16 2" "4 16 2" 41 12 204 2006 "20403 4 17 1" "4 17 1" 39 21 204 2006 "20403 4 19 2" "4 19 2" 27 12 204 2006 "20403 4 21 2" "4 21 2" 26 18 204 2006 "20403 4 21 3" "4 21 3" 29 24 204 2006 "20403 4 22 2" "4 22 2" 29 19 204 2006 "20403 4 23 2" "4 23 2" 35 18 204 2006 "20403 4 23 7" "4 23 7" 23 17 204 2006 "20403 4 24 2" "4 24 2" 40 20 204 2006 "20403 4 27 2" "4 27 2" 35 14 204 2006 "20403 4 28 2" "4 28 2" 30 12 204 2006 "20403 4 29 2" "4 29 2" 30 19 204 2006 "20403 4 29 8" "4 29 8" 28 22 204 2006 "20403 4 31 2" "4 31 2" 25 14 204 2006 "20403 4 32 1" "4 32 1" 45 19 204 2006 "20403 4 33 1" "4 33 1" 38 14 204 2006 "20403 4 35 1" "4 35 1" 40 20 204 2006 "20403 4 36 2" "4 36 2" 18 15 204 2006 "20403 4 38 5" "4 38 5" 30 29 204 2006 "20403 4 39 2" "4 39 2" 20 17 204 2006 "20403 4 40 1" "4 40 1" 47 18 204 2006 "20403 4 41 1" "4 41 1" 28 20 end label values country country_lbl label def country_lbl 204 "Benin", modify label values year year_lbl label def year_lbl 2006 "2006", modify label values age age_lbl label def age_lbl 15 "15", modify label def age_lbl 16 "16", modify label def age_lbl 17 "17", modify label def age_lbl 18 "18", modify label def age_lbl 19 "19", modify label def age_lbl 20 "20", modify label def age_lbl 21 "21", modify label def age_lbl 22 "22", modify label def age_lbl 23 "23", modify label def age_lbl 24 "24", modify label def age_lbl 25 "25", modify label def age_lbl 26 "26", modify label def age_lbl 27 "27", modify label def age_lbl 28 "28", modify label def age_lbl 29 "29", modify label def age_lbl 30 "30", modify label def age_lbl 32 "32", modify label def age_lbl 35 "35", modify label def age_lbl 37 "37", modify label def age_lbl 38 "38", modify label def age_lbl 39 "39", modify label def age_lbl 40 "40", modify label def age_lbl 41 "41", modify label def age_lbl 45 "45", modify label def age_lbl 47 "47", modify label def age_lbl 48 "48", modify label def age_lbl 49 "49", modify label values agefrstmar agefrstmar_lbl label def agefrstmar_lbl 10 "10", modify label def agefrstmar_lbl 11 "11", modify label def agefrstmar_lbl 12 "12", modify label def agefrstmar_lbl 13 "13", modify label def agefrstmar_lbl 14 "14", modify label def agefrstmar_lbl 15 "15", modify label def agefrstmar_lbl 16 "16", modify label def agefrstmar_lbl 17 "17", modify label def agefrstmar_lbl 18 "18", modify label def agefrstmar_lbl 19 "19", modify label def agefrstmar_lbl 20 "20", modify label def agefrstmar_lbl 21 "21", modify label def agefrstmar_lbl 22 "22", modify label def agefrstmar_lbl 23 "23", modify label def agefrstmar_lbl 24 "24", modify label def agefrstmar_lbl 26 "26", modify label def agefrstmar_lbl 29 "29", modify label def agefrstmar_lbl 32 "32", modify label def agefrstmar_lbl 36 "36", modify label def agefrstmar_lbl 37 "37", modify
Comment