Racial IQ gap by SES in the NLSY79 (SPSS syntax)

Read the related page for syntax in other survey data.

Unlike the NLSY97, there were some few cases with grade level of zero. That’s why I included it in my parent grade variable (PARENTEDUC79).

IF R0214700=2 BW=1.
IF R0214700=3 BW=2.

IF R0214700=1 HW=1.
IF R0214700=3 HW=2.

IF R0214700=2 BH=1.
IF R0214700=1 BH=2.

IF R0214700=2 BHW=1.
IF R0214700=1 BHW=2.
IF R0214700=3 BHW=3.

IF R0006500=0 or R0007900=0 PARENTEDUC79=0.
IF R0006500=1 or R0007900=1 PARENTEDUC79=1.
IF R0006500=2 or R0007900=2 PARENTEDUC79=2.
IF R0006500=3 or R0007900=3 PARENTEDUC79=3.
IF R0006500=4 or R0007900=4 PARENTEDUC79=4.
IF R0006500=5 or R0007900=5 PARENTEDUC79=5.
IF R0006500=6 or R0007900=6 PARENTEDUC79=6.
IF R0006500=7 or R0007900=7 PARENTEDUC79=7.
IF R0006500=8 or R0007900=8 PARENTEDUC79=8.
IF R0006500=9 or R0007900=9 PARENTEDUC79=9.
IF R0006500=10 or R0007900=10 PARENTEDUC79=10.
IF R0006500=11 or R0007900=11 PARENTEDUC79=11.
IF R0006500=12 or R0007900=12 PARENTEDUC79=12.
IF R0006500=13 or R0007900=13 PARENTEDUC79=13.
IF R0006500=14 or R0007900=14 PARENTEDUC79=14.
IF R0006500=15 or R0007900=15 PARENTEDUC79=15.
IF R0006500=16 or R0007900=16 PARENTEDUC79=16.
IF R0006500=17 or R0007900=17 PARENTEDUC79=17.
IF R0006500=18 or R0007900=18 PARENTEDUC79=18.
IF R0006500=19 or R0007900=19 PARENTEDUC79=19.
IF R0006500=20 or R0007900=20 PARENTEDUC79=20.

RECODE R0006500 (0 thru 20=COPY) (ELSE=SYSMIS) INTO MOM_EDUC.
RECODE R0007900 (0 thru 20=COPY) (ELSE=SYSMIS) INTO DAD_EDUC.
COMPUTE PARENT_EDUC=MEAN(MOM_EDUC,DAD_EDUC).

RECODE PARENTEDUC79 (0 thru 11=1) (12=2) (13 thru 20=3) (ELSE=SYSMIS) INTO PARENTEDUC3.

COMPUTE SQRT_PARENTAL_INCOME=SQRT(R0217900+1).
VARIABLE LABELS SQRT_PARENTAL_INCOME ‘Square Root of Parental Income’.

COMPUTE PARENTAL_OCCUP=MEAN(R0002200, R0002500).
COMPUTE PARENTAL_OCCUPATION=PARENTAL_OCCUP*-1.

DESCRIPTIVES VARIABLES=PARENTEDUC79 SQRT_PARENTAL_INCOME PARENTAL_OCCUPATION
/SAVE
/STATISTICS=MEAN STDDEV MIN MAX.

FACTOR
/VARIABLES ZPARENTEDUC79 ZPARENTAL_OCCUPATION ZSQRT_PARENTAL_INCOME
/MISSING LISTWISE
/ANALYSIS ZPARENTEDUC79 ZPARENTAL_OCCUPATION ZSQRT_PARENTAL_INCOME
/PRINT INITIAL EXTRACTION
/CRITERIA MINEIGEN(1) ITERATE(25)
/EXTRACTION PAF
/ROTATION NOROTATE
/SAVE REG(ALL)
/METHOD=CORRELATION.

RECODE FAC1_1 (lowest thru highest=COPY) INTO SESgeneralfactor.

COMPUTE BW_SQRTparentalincome=BW*SQRT_PARENTAL_INCOME.
COMPUTE BW_ParentEduc=BW*PARENTEDUC79.
COMPUTE BW_ParentEduc3=BW*PARENTEDUC3.
COMPUTE BW_SESgeneralfactor=BW*SESgeneralfactor.

RECODE SESgeneralfactor (-3 thru -1.05998=1) (-1.05999 thru -0.38000=2) (-0.38001 thru 0.30000=3) (0.30001 thru 1.20001=4) (1.20001 thru 3=5) INTO SESgeneralfactor5.

RECODE SESgeneralfactor5 (1=1) INTO SESgeneralfactor50.
RECODE SESgeneralfactor5 (2=1) (3,4,5,1=0) INTO SESgeneralfactor51.
RECODE SESgeneralfactor5 (3=1) (2,4,5,1=0) INTO SESgeneralfactor52.
RECODE SESgeneralfactor5 (4=1) (2,3,5,1=0) INTO SESgeneralfactor53.
RECODE SESgeneralfactor5 (5=1) (2,3,4,1=0) INTO SESgeneralfactor54.

COMPUTE BW_SESgeneralfactor51=BW*SESgeneralfactor51.
COMPUTE BW_SESgeneralfactor52=BW*SESgeneralfactor52.
COMPUTE BW_SESgeneralfactor53=BW*SESgeneralfactor53.
COMPUTE BW_SESgeneralfactor54=BW*SESgeneralfactor54.

RECODE PARENTEDUC3 (1=1) INTO PARENTEDUC30.
RECODE PARENTEDUC3 (2=1) (3,1=0) INTO PARENTEDUC31.
RECODE PARENTEDUC3 (3=1) (2,1=0) INTO PARENTEDUC32.

COMPUTE BW_PARENTEDUC31=BW*PARENTEDUC31.
COMPUTE BW_PARENTEDUC32=BW*PARENTEDUC32.

COMPUTE BW_ParentEduc3=BW*PARENTEDUC3.

FREQUENCIES VARIABLES=PARENTEDUC79 SQRT_PARENTAL_INCOME PARENTAL_OCCUPATION SESgeneralfactor SESgeneralfactor5
/FORMAT=NOTABLE
/HISTOGRAM NORMAL
/ORDER=ANALYSIS.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0615000
/METHOD=ENTER R0214800 R0000600
/SAVE ZRESID.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0615100
/METHOD=ENTER R0214800 R0000600
/SAVE ZRESID.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0615200
/METHOD=ENTER R0214800 R0000600
/SAVE ZRESID.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0615300
/METHOD=ENTER R0214800 R0000600
/SAVE ZRESID.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0615400
/METHOD=ENTER R0214800 R0000600
/SAVE ZRESID.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0615500
/METHOD=ENTER R0214800 R0000600
/SAVE ZRESID.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0615600
/METHOD=ENTER R0214800 R0000600
/SAVE ZRESID.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0615700
/METHOD=ENTER R0214800 R0000600
/SAVE ZRESID.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0615800
/METHOD=ENTER R0214800 R0000600
/SAVE ZRESID.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0615900
/METHOD=ENTER R0214800 R0000600
/SAVE ZRESID.

RECODE ZRE_1 (lowest thru highest=COPY) INTO GENERAL_SCIENCE.
RECODE ZRE_2 (lowest thru highest=COPY) INTO ARITHMETIC_REASONING.
RECODE ZRE_3 (lowest thru highest=COPY) INTO WORD_KNOWLEDGE.
RECODE ZRE_4 (lowest thru highest=COPY) INTO PARAGRAPH_COMPREHENSION.
RECODE ZRE_5 (lowest thru highest=COPY) INTO NUMERICAL_OPERATIONS.
RECODE ZRE_6 (lowest thru highest=COPY) INTO CODING_SPEED.
RECODE ZRE_7 (lowest thru highest=COPY) INTO AUTO_AND_SHOP_INFO.
RECODE ZRE_8 (lowest thru highest=COPY) INTO MATHEMATICS_KNOWLEDGE.
RECODE ZRE_9 (lowest thru highest=COPY) INTO MECHANICAL_COMPREHENSION.
RECODE ZRE_10 (lowest thru highest=COPY) INTO ELECTRONICS_INFORMATION.

FACTOR
/VARIABLES GENERAL_SCIENCE ARITHMETIC_REASONING WORD_KNOWLEDGE PARAGRAPH_COMPREHENSION NUMERICAL_OPERATIONS
CODING_SPEED AUTO_AND_SHOP_INFO MATHEMATICS_KNOWLEDGE MECHANICAL_COMPREHENSION ELECTRONICS_INFORMATION
/MISSING LISTWISE
/ANALYSIS GENERAL_SCIENCE ARITHMETIC_REASONING WORD_KNOWLEDGE PARAGRAPH_COMPREHENSION NUMERICAL_OPERATIONS
CODING_SPEED AUTO_AND_SHOP_INFO MATHEMATICS_KNOWLEDGE MECHANICAL_COMPREHENSION ELECTRONICS_INFORMATION
/PRINT UNIVARIATE INITIAL CORRELATION SIG DET KMO EXTRACTION
/PLOT EIGEN
/CRITERIA FACTORS(2) ITERATE(25)
/EXTRACTION PAF
/ROTATION NOROTATE
/SAVE REG(ALL)
/METHOD=CORRELATION.

RECODE FAC1_2 (lowest thru highest=COPY) INTO G_score.
RECODE FAC2_2 (lowest thru highest=COPY) INTO non_G_score.

MEANS TABLES=R0618301 G_score non_G_score PARENTEDUC79 BY BHW BY PARENTEDUC3
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=R0618301 G_score non_G_score PARENTEDUC79 BY BHW
/CELLS MEAN COUNT STDDEV.

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0618301
/METHOD=ENTER R0000600 R0214800 BW PARENTEDUC79
/METHOD=ENTER BW_ParentEduc
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0618301
/METHOD=ENTER R0000600 R0214800 BW SQRT_PARENTAL_INCOME
/METHOD=ENTER BW_SQRTparentalincome
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0618301
/METHOD=ENTER R0000600 R0214800 BW SESgeneralfactor
/METHOD=ENTER BW_SESgeneralfactor
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0618301
/METHOD=ENTER R0000600 R0214800 BW SESgeneralfactor5
/METHOD=ENTER BW_SESgeneralfactor51 to BW_SESgeneralfactor54
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

WEIGHT BY R0614601.

MEANS TABLES=R0618301 G_score non_G_score PARENTEDUC79 BY BHW BY PARENTEDUC3
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=R0618301 G_score non_G_score PARENTEDUC79 BY BHW
/CELLS MEAN COUNT STDDEV.

WEIGHT BY R0614600.

MEANS TABLES=R0618301 G_score non_G_score PARENTEDUC79 BY BHW BY PARENTEDUC3
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=R0618301 G_score non_G_score PARENTEDUC79 BY BHW
/CELLS MEAN COUNT STDDEV.

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0618301
/METHOD=ENTER R0000600 R0214800 BW PARENTEDUC79
/METHOD=ENTER BW_ParentEduc
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0618301
/METHOD=ENTER R0000600 R0214800 BW SQRT_PARENTAL_INCOME
/METHOD=ENTER BW_SQRTparentalincome
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT G_score
/METHOD=ENTER R0000600 R0214800 BW PARENTEDUC79
/METHOD=ENTER BW_ParentEduc
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT G_score
/METHOD=ENTER R0000600 R0214800 BW SQRT_PARENTAL_INCOME
/METHOD=ENTER BW_SQRTparentalincome
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT non_G_score
/METHOD=ENTER R0000600 R0214800 BW PARENTEDUC79
/METHOD=ENTER BW_ParentEduc
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT non_G_score
/METHOD=ENTER R0000600 R0214800 BW SQRT_PARENTAL_INCOME
/METHOD=ENTER BW_SQRTparentalincome
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

UNIANOVA R0618301 BY BW PARENTEDUC3 WITH R0000600 R0214800
/METHOD=SSTYPE(3)
/INTERCEPT=INCLUDE
/PLOT=PROFILE(PARENTEDUC3*BW)
/EMMEANS=TABLES(BW) WITH(R0000600=MEAN R0214800=MEAN)
/EMMEANS=TABLES(PARENTEDUC3) WITH(R0000600=MEAN R0214800=MEAN)
/EMMEANS=TABLES(BW*PARENTEDUC3) WITH(R0000600=MEAN R0214800=MEAN)
/PRINT=LOF OPOWER ETASQ HOMOGENEITY DESCRIPTIVE
/PLOT=SPREADLEVEL RESIDUALS
/CRITERIA=ALPHA(.05)
/DESIGN=R0000600 R0214800 BW PARENTEDUC3 BW*PARENTEDUC3.

UNIANOVA G_score BY BW PARENTEDUC3 WITH R0000600 R0214800
/METHOD=SSTYPE(3)
/INTERCEPT=INCLUDE
/PLOT=PROFILE(PARENTEDUC3*BW)
/EMMEANS=TABLES(BW) WITH(R0000600=MEAN R0214800=MEAN)
/EMMEANS=TABLES(PARENTEDUC3) WITH(R0000600=MEAN R0214800=MEAN)
/EMMEANS=TABLES(BW*PARENTEDUC3) WITH(R0000600=MEAN R0214800=MEAN)
/PRINT=LOF OPOWER ETASQ HOMOGENEITY DESCRIPTIVE
/PLOT=SPREADLEVEL RESIDUALS
/CRITERIA=ALPHA(.05)
/DESIGN=R0000600 R0214800 BW PARENTEDUC3 BW*PARENTEDUC3.

UNIANOVA non_G_score BY BW PARENTEDUC3 WITH R0000600 R0214800
/METHOD=SSTYPE(3)
/INTERCEPT=INCLUDE
/PLOT=PROFILE(PARENTEDUC3*BW)
/EMMEANS=TABLES(BW) WITH(R0000600=MEAN R0214800=MEAN)
/EMMEANS=TABLES(PARENTEDUC3) WITH(R0000600=MEAN R0214800=MEAN)
/EMMEANS=TABLES(BW*PARENTEDUC3) WITH(R0000600=MEAN R0214800=MEAN)
/PRINT=LOF OPOWER ETASQ HOMOGENEITY DESCRIPTIVE
/PLOT=SPREADLEVEL RESIDUALS
/CRITERIA=ALPHA(.05)
/DESIGN=R0000600 R0214800 BW PARENTEDUC3 BW*PARENTEDUC3.

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0618301
/METHOD=ENTER R0000600 R0214800 BW SESgeneralfactor
/METHOD=ENTER BW_SESgeneralfactor
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT G_score
/METHOD=ENTER R0000600 R0214800 BW SESgeneralfactor
/METHOD=ENTER BW_SESgeneralfactor
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT non_G_score
/METHOD=ENTER R0000600 R0214800 BW SESgeneralfactor
/METHOD=ENTER BW_SESgeneralfactor
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT R0618301
/METHOD=ENTER R0000600 R0214800 BW SESgeneralfactor5
/METHOD=ENTER BW_SESgeneralfactor51 to BW_SESgeneralfactor54
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT G_score
/METHOD=ENTER R0000600 R0214800 BW SESgeneralfactor5
/METHOD=ENTER BW_SESgeneralfactor51 to BW_SESgeneralfactor54
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

WEIGHT OFF.

FILTER OFF.
USE ALL.
EXECUTE.

This entry was posted in Stats, Softwares, Syntax and tagged . Bookmark the permalink.