Racial IQ gap by SES in the HSLS 2009 (SPSS syntax)

Read the related page for syntax in other survey data.

FREQUENCIES VARIABLES=X1SES X1SESQ5 X1TXMTH X1TXMSCR
/FORMAT=NOTABLE
/HISTOGRAM NORMAL
/ORDER=ANALYSIS.

RECODE X1RACE (3=0) (8=1) (ELSE=SYSMIS) INTO BW.
RECODE X1SEX (1=1) (2=2) (ELSE=SYSMIS) INTO GENDER.

RECODE X1SES (-5 thru highest=COPY) (ELSE=SYSMIS) INTO X1SES_nomissing.
RECODE X1SESQ5 (-5 thru highest=COPY) (ELSE=SYSMIS) INTO X1SESQ5_nomissing.
RECODE X1TXMTH (-5 thru highest=COPY) (ELSE=SYSMIS) INTO X1TXMTH_nomissing.
RECODE X1TXMSCR (-5 thru highest=COPY) (ELSE=SYSMIS) INTO X1TXMSCR_nomissing.
RECODE X1TXMTSCOR (-5 thru highest=COPY) (ELSE=SYSMIS) INTO X1TXMTSCOR_nomissing.

COMPUTE BW_SES=BW*X1SES_nomissing.
COMPUTE BW_SESQ5=BW*X1SESQ5_nomissing.

RECODE X1SESQ5_nomissing (1=1) INTO X1SESQ50.
RECODE X1SESQ5_nomissing (2=1) (3,4,5,1=0) INTO X1SESQ51.
RECODE X1SESQ5_nomissing (3=1) (2,4,5,1=0) INTO X1SESQ52.
RECODE X1SESQ5_nomissing (4=1) (2,3,5,1=0) INTO X1SESQ53.
RECODE X1SESQ5_nomissing (5=1) (2,3,4,1=0) INTO X1SESQ54.

COMPUTE BW_X1SESQ51=BW*X1SESQ51.
COMPUTE BW_X1SESQ52=BW*X1SESQ52.
COMPUTE BW_X1SESQ53=BW*X1SESQ53.
COMPUTE BW_X1SESQ54=BW*X1SESQ54.

FREQUENCIES VARIABLES=X1SES_nomissing X1SESQ5_nomissing X1TXMTH_nomissing X1TXMSCR_nomissing
/FORMAT=NOTABLE
/HISTOGRAM NORMAL
/ORDER=ANALYSIS.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT X1TXMTH_nomissing
/METHOD=ENTER GENDER X1SES_nomissing
/SAVE RESID ZRESID.

RECODE RES_1 (lowest thru highest=COPY) INTO MathTheta_SESregressed.
RECODE ZRE_1 (lowest thru highest=COPY) INTO zMathTheta_SESregressed.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT X1TXMSCR_nomissing
/METHOD=ENTER GENDER X1SES_nomissing
/SAVE RESID ZRESID.

RECODE RES_2 (lowest thru highest=COPY) INTO MathIRT_SESregressed.
RECODE ZRE_2 (lowest thru highest=COPY) INTO zMathIRT_SESregressed.

MEANS TABLES=X1TXMTH_nomissing X1TXMTSCOR_nomissing X1TXMSCR_nomissing zMathTheta_SESregressed zMathIRT_SESregressed BY X1RACE
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=X1TXMTH_nomissing X1TXMTSCOR_nomissing X1TXMSCR_nomissing BY X1RACE BY X1SESQ5
/CELLS MEAN COUNT STDDEV.

WEIGHT BY W1STUDENT.

MEANS TABLES=X1TXMTH_nomissing X1TXMTSCOR_nomissing X1TXMSCR_nomissing zMathTheta_SESregressed zMathIRT_SESregressed BY X1RACE
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=X1TXMTH_nomissing X1TXMTSCOR_nomissing X1TXMSCR_nomissing BY X1RACE BY X1SESQ5
/CELLS MEAN COUNT STDDEV.

WEIGHT BY W1PARENT.

MEANS TABLES=X1TXMTH_nomissing X1TXMTSCOR_nomissing X1TXMSCR_nomissing zMathTheta_SESregressed zMathIRT_SESregressed BY X1RACE
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=X1TXMTH_nomissing X1TXMTSCOR_nomissing X1TXMSCR_nomissing BY X1RACE BY X1SESQ5
/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 X1TXMTH_nomissing
/METHOD=ENTER GENDER BW X1SES
/METHOD=ENTER BW_SES
/PARTIALPLOT ALL
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID)
/SAVE PRED ZPRED RESID ZRESID.

GRAPH
/SCATTERPLOT(BIVAR)=X1SES_nomissing WITH ZPR_1 BY BW
/MISSING=LISTWISE.

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 X1TXMTH_nomissing
/METHOD=ENTER GENDER BW X1SESQ5
/METHOD=ENTER BW_SESQ5
/PARTIALPLOT ALL
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID)
/SAVE PRED ZPRED RESID ZRESID.

GRAPH
/SCATTERPLOT(BIVAR)=X1SESQ5_nomissing WITH ZPR_2 BY BW
/MISSING=LISTWISE.

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 X1TXMTH_nomissing
/METHOD=ENTER GENDER BW X1SESQ5
/METHOD=ENTER BW_X1SESQ51 to BW_X1SESQ54
/PARTIALPLOT ALL
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID)
/SAVE PRED ZPRED RESID ZRESID.

GRAPH
/SCATTERPLOT(BIVAR)=X1SESQ5_nomissing WITH ZPR_3 BY BW
/MISSING=LISTWISE.

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

WEIGHT OFF.

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