Dear all,
I am having difficulties with reshape long for the NLSY97 data in Stata 14.0.
I have read all previous posts and guides but I cannot figure out how to reshape my data.
I have downloaded over 6.000 variables from the INvestigator webpage. I do not plan to use them all but I want to explore them in the appropiate format.
I am uploading a sample of the variables. Some have the year in the middle of the name, others at the end, and others have the year in a 2 digits format i.e. CVC_HOURS_WK_YR_SE_00_XRND (00 refers to 2000)
So far my problems is:
1. I have too many variables with different name formats so I think I need to rename my variables.
I would be grateful if you can give me some guidance on how to proceed with reshape with these type of variables. If you have used NLSY97 before I would also appreciate learning from your experience reshaping this data.
thank you in advance for your help.
Alejandra.
I am having difficulties with reshape long for the NLSY97 data in Stata 14.0.
I have read all previous posts and guides but I cannot figure out how to reshape my data.
I have downloaded over 6.000 variables from the INvestigator webpage. I do not plan to use them all but I want to explore them in the appropiate format.
I am uploading a sample of the variables. Some have the year in the middle of the name, others at the end, and others have the year in a 2 digits format i.e. CVC_HOURS_WK_YR_SE_00_XRND (00 refers to 2000)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(PUBID_1997 EMP_STATUS_1994_01_XRND EMP_STATUS_1994_02_XRND EMP_STATUS_1995_01_XRND EMP_STATUS_1995_02_XRND YEMP_101104_01_2000 YEMP_101104_02_2000 YEMP_101106_01_2000 YEMP_101106_02_2000 CVC_HOURS_WK_YR_SE_00_XRND CVC_HOURS_WK_YR_SE_01_XRND) 1 -4 -4 -4 -4 -4 -4 -4 -4 0 0 2 -4 -4 -4 -4 -4 -4 -4 -4 0 0 3 -4 -4 -4 -4 -4 -4 -4 -4 0 0 4 -4 -4 -4 -4 -4 -4 -4 -4 0 0 5 -4 -4 -4 -4 -4 -4 -4 -4 0 0 6 -4 -4 -4 -4 -4 -4 -4 -4 0 0 7 -4 -4 -4 -4 -4 -4 -4 -4 0 0 8 -4 -4 -4 -4 -4 -4 -4 -4 0 0 9 -4 -4 -4 -4 -4 -4 -4 -4 0 0 10 -4 -4 -4 -4 -4 -4 -4 -4 0 0 11 -4 -4 -4 -4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-4 -4 -4 -4 -4 0 0 81 -4 -4 -4 -4 -4 -4 -4 -4 0 0 82 -4 -4 -4 -4 -4 -4 -4 -4 0 0 83 -4 -4 -4 -4 -4 -4 -4 -4 0 1160 84 -4 -4 -4 -4 -4 -4 -4 -4 0 0 85 -4 -4 -4 -4 -4 -4 -4 -4 0 0 86 -4 -4 5 5 -4 -4 -4 -4 0 0 87 -4 -4 -4 -4 -4 -4 -4 -4 0 0 88 -4 -4 -4 -4 -4 -4 -4 -4 0 1698 89 -4 -4 -4 -4 -4 -4 1 -4 782 150 90 -4 -4 -4 -4 -4 -4 -4 -4 0 0 91 -4 -4 -4 -4 -4 -4 -4 -4 0 0 92 -4 -4 -4 -4 -4 -4 -4 -4 0 0 93 -4 -4 -4 -4 -4 -4 -4 -4 0 0 94 -4 -4 4 4 -4 -4 -4 -4 0 0 95 -4 -4 -4 -4 -5 -5 -5 -5 31 52 96 -4 -4 -4 -4 -5 -5 -5 -5 0 0 97 -4 -4 5 5 -4 -4 -4 -4 0 0 98 -4 -4 5 5 -4 -4 -4 -4 0 0 99 -4 -4 -4 -4 -4 -4 -4 -4 0 0 100 -4 -4 -4 -4 -4 -4 -4 -4 0 0 end label values PUBID_1997 vlR0000100 label values EMP_STATUS_1994_01_XRND vlE0011401 label values EMP_STATUS_1994_02_XRND vlE0011402 label values EMP_STATUS_1995_01_XRND vlE0011501 label def vlE0011501 0 "0: No information reported to account for week; job dates indeterminate", modify label def vlE0011501 1 "1: Not associated with an employer, not actively searching for an employer job", modify label def vlE0011501 4 "4: Unemployed", modify label def vlE0011501 5 "5: Out of the labor force", modify label values EMP_STATUS_1995_02_XRND vlE0011502 label def vlE0011502 0 "0: No information reported to account for week; job dates indeterminate", modify label def vlE0011502 1 "1: Not associated with an employer, not actively searching for an employer job", modify label def vlE0011502 4 "4: Unemployed", modify label def vlE0011502 5 "5: Out of the labor force", modify label values YEMP_101104_01_2000 vlR4768500 label values YEMP_101104_02_2000 vlR4768600 label values YEMP_101106_01_2000 vlR4769300 label def vlR4769300 1 "RUN BUSINESS FROM HOME", modify label values YEMP_101106_02_2000 vlR4769400 label values CVC_HOURS_WK_YR_SE_00_XRND vlZ9071800 label def vlZ9071800 0 "0", modify label values CVC_HOURS_WK_YR_SE_01_XRND vlZ9071900 label def vlZ9071900 0 "0", modify
1. I have too many variables with different name formats so I think I need to rename my variables.
I would be grateful if you can give me some guidance on how to proceed with reshape with these type of variables. If you have used NLSY97 before I would also appreciate learning from your experience reshaping this data.
thank you in advance for your help.
Alejandra.
Comment