Extraction Process

advertisement
Extraction and Merge Process
NLSY79 Main Youth and Child/Young Adult Data
Age at First Marijuana Use
Canada Keck
I.
Open Web Investigator by double clicking on the icon on your desktop, click
on the Public NLS Investigator link, click on “Web Investigator,” click on the
Young Adult 2006 link. This is the preliminary release data for the YA2006
survey.
A. Click on the drop-down menu next to Question Name under Add a Filter
1. Scroll down to find PUB_ and click on it
2. Click on the “Submit Filter Choice(s)” button
3. Click on the box next to the reference number (Y1450000) to tag
this variable. This is the public ID necessary for merging with
other Child/YA data.
B. Click on the drop-down menu next to Area of Interest
1. Scroll down to YA SELF REPORT and click on it
2. Click on the drop-down menu next to Word in Title
3. Hit the M key to get quickly to words beginning with M, then
scroll down to the word ‘marijuana’ in the list, then click on it.
4. Click on the “Submit Filter Choice(s)” button
5. In the resulting variable list, click on the box next to the
reference numbers for the following variables:
a. HAVE YOU EVER USED MARIJUANA (Y1684700)
b. AGE OF RESPONDENT WHEN FIRST USED
MARIJUANA (Y1684900)
C. Scroll down past the variable list and click on the “Review Tagged
Variables” button. On the resulting list, verify that you have selected all
of the variables needed
D. Once you have all needed variables, scroll down to the Tag Set
Maintenance area and type ‘agemarj06’ into the box next to the “Save Tag
Set” button.
E. At this point you can either save it on your machine or on the server. If
you think you will want the tag set available more the three months from
now, save to your machine. Otherwise, you can save to the server and not
worry about file maintenance. For today, click on the “Save Tag Set on
Server” button.
F. You will now see a message that your tag set has been saved. Click on
the “Web Investigator” button at the top to return to the variable page.
G. Click on the “Extract Tagged Variables” button.
H. On the extraction page, choose the Delimited ASCII file option and click
on the “Submit Extract” button.
I. After your extract has completed running, you will see a zip container
with the name of your tag set with an alphanumeric string appended.
Click on this zip container.
II.
J. You will see a dialog box asking you whether you want to save this file or
open it. When you are doing your own research, you may wish to save
your extracted data to your computer. For today, choose the Open option.
K. You now have an open zip container with all of the output from your
extract. Select the extract button and extract all of these files to C: drive
of your laptop and close the zip container.
At this point, return to the Web Investigator page and click on the “Web
Investigator” button at the top to return to the main page. Click on the drop
down list next to the Select a Different Cohort option and select NLSY
Child/Young Adult 1986-2004. This is the merged 2004 public release data.
You will see a warning box asking you is you are sure you would like to
change cohorts. Click on Okay.
A. Click on the drop-down menu next to Area of Interest
1. Scroll down to the CHILD BACKGROUND area of interest and
click on it to select it.
2. Click on the “Submit Filter Choice(s)” button
3. In the resulting variable list, click on the box next to the
reference numbers for the following variables:
a. ID CODE OF CHILD (C0000100). This is the public ID
necessary for merging with the YA2004 data.
b. ID CODE OF MOTHER OF CHILD (C0000200). This is
the public ID necessary for merging with the mother’s data.
c. RACE OF CHILD (MOTHER'S RACIAL/ETHNIC
COHORT FROM SCREENER) [C0005300]
d. SEX OF CHILD (C0005400)
e. WAS CHILD INTERVIEWED AS YOUNG ADULT?
[1994] (C0011201)
f. WAS CHILD INTERVIEWED AS YOUNG ADULT?
[1996] (C0011203)
g. WAS CHILD INTERVIEWED AS YOUNG ADULT?
[1998] (C0011205)
h. WAS CHILD INTERVIEWED AS YOUNG ADULT?
[2000] (C0011207)
i. WAS CHILD INTERVIEWED AS YOUNG ADULT?
[2002] (C0011209)
j. WAS CHILD INTERVIEWED AS YOUNG ADULT?
[2004] (C0011211)
4. Scroll down and click on the “Review Tagged Variables” button
to verify that you have selected the proper variables.
B. Click on the drop-down menu next to Word in Title
1. Hit the M key to get quickly to words beginning with M, then
scroll down to the word ‘marijuana’ in the list, then click on it.
2. Type the word “age” with a blank space in front of it into the box
next to Search Variable Title. The blank space ensures that you
will search for the word “age” and not every word with the string
“age” in it (i.e., manage, average).
3. Click on the “Submit Filter Choice(s)” button
4. Click on the “Tag All” button below the variable list to select the
sixteen variables having the words marijuana and age in their
titles:
a. CHILD SELF-ADMINISTERED: R'S AGE WHEN FIRST
USED MARIJUANA [1988] (C0733300)
b. CHILD SELF-ADMINISTERED: R'S AGE WHEN FIRST
USED MARIJUANA [1990] (C0945000)
c. CHILD SELF-ADMINISTERED: CHILD'S AGE WHEN
FIRST USED MARIJUANA [1992] (C1140400)
d. CHILD SELF-ADMINISTERED: CHILD'S AGE WHEN
FIRST USED MARIJUANA [1994] (C1370500)
e. CHILD SELF-ADMINISTERED: CHILD'S AGE WHEN
FIRST USED MARIJUANA [1996] (C1592600)
f. CHILD SELF-ADMINISTERED: CHILD'S AGE WHEN
FIRST USED MARIJUANA [1998] (C1933400)
g. CHILD SELF-ADMINISTERED: CHILD'S AGE WHEN
FIRST USED MARIJUANA [2000] (C2472600)
h. CHILD SELF-ADMINISTERED: CHILD'S AGE WHEN
FIRST USED MARIJUANA [2002] (C2770600)
i. CHILD SELF-ADMIN: CHILD'S AGE WHEN FIRST
USED MARIJUANA [2004] (C3050500)
j. YA SELF-REPORT:AGE OF RESPONDENT WHEN
FIRST USED MARIJUANA [1994] (Y0364900)
k. YA SELF-REPORT:AGE OF RESPONDENT WHEN
FIRST USED MARIJUANA [1996] (Y0658900)
l. YA SELF-REPORT:AGE OF RESPONDENT WHEN
FIRST USED MARIJUANA [1998] (Y09548900)
m. AGE OF RESPONDENT WHEN FIRST USED
MARIJUANA [2000] (Y1168700)
n. AGE OF RESPONDENT WHEN FIRST USED
MARIJUANA [2002] (Y1407900)
o. MACHINE CHECK: HAS R REPORTED AGE FIRST
USED MARIJUANA IN PREVIOUS SURVEYS? [2004]
(Y1659200)
p. AGE OF RESPONDENT WHEN FIRST USED
MARIJUANA [2004] (Y1659300)
C. Scroll down and click on the “Review Tagged Variables” button again to
verify that you have selected the proper variables. At this point you should
have 16 variables related to age at first marijuana use and 10 variables
selected from the Child Background Area of Interest.
D. Once you have all needed variables, scroll down to the Tag Set
Maintenance area and type ‘agemarj04’ into the box next to the “Save Tag
Set” button.
E. Click on the “Save Tag Set on Server” button.
III.
F. You will now see a message that your tag set has been saved. Click on
the “Web Investigator” button at the top to return to the variable page.
G. Click on the “Extract Tagged Variables” button.
H. On the extraction page, choose the Delimited ASCII file option and click
on the “Submit Extract” button.
I. After your extract has completed running, you will see a zip container
with the name of your tag set with an alphanumeric string appended.
Click on this zip container.
J. You will see a dialog box asking you whether you want to save this file or
open it. Choose the Open option.
K. You now have an open zip container with all of the output from your
extract. Select the extract button and extract all of these files to C: drive
of your laptop and close the zip container.
At this point, return to the Web Investigator page and click on the “Web
Investigator” button at the top to return to the main page. Click on the drop
down list next to the Select a Different Cohort option and select NLSY79
(1979-2004) data. You will see a warning box asking you is you are sure you
would like to change cohorts. Click on Okay.
A. Click on drop-down list next to Reference Number
1. Scroll to the R000 category and click to select it
2. Click on the “Submit Filter Choice(s)” button.
3. Click on the box next to the reference number (R0000100) of the
first variable in that list (IDENTIFICATION CODE). This is the
public ID of the mother necessary for merging with the
Child/YA data.
B. Click on the drop-down menu next to Word in Title
1. Hit the M key to get quickly to words beginning with M, then
scroll down to the word ‘marijuana’ in the list, then click on it.
2. Click on the “Submit Filter Choice(s)” button.
3. Click in the box next to “MARIJUANA” under the Filters
Applied heading to keep this filter.
4. Hit the A key to get quickly to words beginning with A, then
scroll down to the word ‘age’ in the list, then click on it.
5. Click on the “Submit Filter Choice(s)” button.
6. You should see 5 items relating to age at first marijuana use in
the Variable List:
a. DRUG USE - AGE WHEN 1ST USED MARIJUANA OR
HASHISH [1984] (R1395400)
b. DRUG USE - AGE WHEN 1ST USED MARIJUANA OR
HASHISH [1988] (R2720900)
c. DRUG USE - AGE WHEN 1ST USED MARIJUANA
[1992] (R3915100)
d. DRUG USE - AGE WHEN 1ST USED MARIJUANA
[1994] (R5053200)
e. DRUG USE - AGE WHEN 1ST USED MARIJUANA
[1998] (R6430500)
IV.
7. Click on the “Tag All” button.
8. Type the word ‘times’ in the Search Variable Title box then click
on the “Submit Filter Choice(s)” button.
9. In the resulting variable list, click on the box next to the
reference number for the following variables:
a. DRUG USE - # OF TIMES EVER USED MARIJUANA
OR HASHISH 84 INT (R1395100)
b. DRUG USE - # OF TIMES USED MARIJUANA OR
HASHISH IN LIFETIME 88 INT (R2720800)
c. DRUG USE - # OF TIMES USED MARIJUANA IN
LIFETIME 92 INT (R3915000)
d. DRUG USE - # OF TIMES USED MARIJUANA IN
LIFETIME [1994] (R5053100)
e. DRUG USE - # OF TIMES USED MARIJUANA IN
LIFETIME [1998] (R6430400)
C. Scroll down and click on the “Review Tagged Variables” button again to
verify that you have selected the proper variables. At this point you should
have the 5 variables related to age at first marijuana use, the 5 variables
related to lifetime use, and the public ID.
D. Once you have all needed variables, scroll down to the Tag Set
Maintenance area and type ‘mommarj04’ into the box next to the “Save
Tag Set” button.
E. Click on the “Save Tag Set on Server” button.
F. You will now see a message that your tag set has been saved. Click on
the “Web Investigator” button at the top to return to the variable page.
G. Click on the “Extract Tagged Variables” button.
H. On the extraction page, choose the Delimited ASCII file option and click
on the “Submit Extract” button.
I. After your extract has completed running, you will see a zip container
with the name of your tag set with an alphanumeric string appended.
Click on this zip container.
J. You will see a dialog box asking you whether you want to save this file or
open it. Choose the Open option.
K. You now have an open zip container with all of the output from your
extract. Select the extract button and extract all of these files to C: drive
of your laptop and close the zip container.
The Workshop web page already contains a SAS program titled
AGEMARIJ.SAS, along with the extracted data files, under Files, Keck, so
that you may open it and easily run it. Please download this program and my
data files to your C: drive so that you can open and use it. The steps to create
this program are listed below.
A. Open the file called read_agemarj06-####.sas. Save it as agemarj.sas.
1. Name the data step “one”
2. Add “C:\” to the name of the data file
3. Change variable Y1450000 to CPUBID (child’s public ID) in
preparation for merging
B.
C.
D.
E.
F.
G.
H.
I.
4. Comment out syntax for recoding missing data
5. Create a flag for YAs interviewed in 2006
6. Sort by CPUBID
Open the file called read_agemarj04-####.sas and copy from the word
“data” through the last label statement.
1. Paste it into agemarj.sas and name the data step “two”
2. Change variable C0000100 to CPUBID (child’s public ID) and
C0000200 to PUBID (mother’s public ID) in preparation for
merging
3. Add “C:\” to the name of the data file
4. Comment out syntax for recoding missing data
5. Sort by CPUBID
Type in data step (three) necessary for merging and restricting to
respondents who have ever been interviewed as a YA, then resorting the
data by PUBID (mom’s public ID)
Open the file called read_mommarj02-####.sas and copy from the word
“data” through the last label statement.
1. Paste it into agemarj.sas and name the data step “four”
2. Add “C:\” to the name of the data file
3. Comment out syntax for recoding missing data
4. Change variable R0000100 to PUBID (mom’s public ID) in
preparation for merging
5. Sort by PUBID
Type in data step (five) necessary for merging and restricting the data to
those in the YA-based merged file, resulting in data for only respondents
who have ever been interviewed as a YA
Construct age at variables for both YAs and moms
Construct Yes/No variables for moms and YAs
Format variables
Run Crosstabs
Download