Racial IQ gap by SES in the Add Health (SPSS syntax)

Read the related page for syntax in other survey data.

IF H1GI6B=1 and H3OD4B=1 and H1GI6A=0 and H3OD4A=0 and H1GI4=0 and H3OD2=0 BW=0.
IF H1GI6B=0 and H3OD4B=0 and H1GI6A=1 and H3OD4A=1 and H1GI4=0 and H3OD2=0 BW=1.

COMPUTE sqrtEARNINGS=SQRT(H4EC2).
VARIABLE LABELS sqrtEARNINGS ‘square root of respondent earnings’.

RECODE PA12 (1 thru 3=1) (4 thru 6=2) (7 thru 9=3) (ELSE=SYSMIS) INTO ParEduc3.
VARIABLE LABELS ParEduc3 ‘Parental_Education’.

DESCRIPTIVES VARIABLES=AH_PVT PVTSTD1 PVTSTD3C PVTSTD3L
/SAVE
/STATISTICS=MEAN STDDEV MIN MAX.

COMPUTE BW_ParEduc3=BW*ParEduc3.
COMPUTE BW_ParentEduc=BW*PA12.

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

RECODE ZRE_1 (lowest thru highest=COPY) INTO AH_PVT_Cross_Sectional_W3.

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

RECODE ZRE_2 (lowest thru highest=COPY) INTO AH_PVT_Longitudinal_L3.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT PVTSTD1
/METHOD=ENTER H1GI1M H1GI1Y BIO_SEX
/SAVE ZRESID.

RECODE ZRE_3 (lowest thru highest=COPY) INTO AH_PVT_Cross_Sectional_W1.

REGRESSION
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT AH_PVT
/METHOD=ENTER H1GI1M H1GI1Y BIO_SEX
/SAVE ZRESID.

RECODE ZRE_4 (lowest thru highest=COPY) INTO AH_PVT_W1.

USE ALL.
COMPUTE filter_$=(ZAH_PVT>-3).
VARIABLE LABELS filter_$ ‘ZAH_PVT>-3 (FILTER)’.
VALUE LABELS filter_$ 0 ‘Not Selected’ 1 ‘Selected’.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

MEANS TABLES=AH_PVT_W1 AH_PVT_Cross_Sectional_W1 BY ParEduc3 BY BW
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=AH_PVT_W1 AH_PVT_Cross_Sectional_W1 BY BW
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=AH_PVT_W1 AH_PVT_Cross_Sectional_W1
/CELLS MEAN COUNT STDDEV.

FREQUENCIES VARIABLES=ZAH_PVT ZPVTSTD1
/FORMAT=NOTABLE
/HISTOGRAM NORMAL
/ORDER=ANALYSIS.

USE ALL.
COMPUTE filter_$=(ZPVTSTD3L>-3).
VARIABLE LABELS filter_$ ‘ZPVTSTD3L>-3 (FILTER)’.
VALUE LABELS filter_$ 0 ‘Not Selected’ 1 ‘Selected’.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

MEANS TABLES=AH_PVT_Longitudinal_L3 AH_PVT_Cross_Sectional_W3 BY ParEduc3 BY BW
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=AH_PVT_Longitudinal_L3 AH_PVT_Cross_Sectional_W3 BY BW
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=AH_PVT_Longitudinal_L3 AH_PVT_Cross_Sectional_W3
/CELLS MEAN COUNT STDDEV.

FREQUENCIES VARIABLES=ZPVTSTD3C ZPVTSTD3L
/FORMAT=NOTABLE
/HISTOGRAM NORMAL
/ORDER=ANALYSIS.

WEIGHT BY GSWGT1.

USE ALL.
COMPUTE filter_$=(ZAH_PVT>-3).
VARIABLE LABELS filter_$ ‘ZAH_PVT>-3 (FILTER)’.
VALUE LABELS filter_$ 0 ‘Not Selected’ 1 ‘Selected’.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

MEANS TABLES=AH_PVT_W1 AH_PVT_Cross_Sectional_W1 BY ParEduc3 BY BW
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=AH_PVT_W1 AH_PVT_Cross_Sectional_W1 BY BW
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=AH_PVT_W1 AH_PVT_Cross_Sectional_W1
/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 AH_PVT
/METHOD=ENTER H1GI1M H1GI1Y BIO_SEX BW PA12
/METHOD=ENTER BW_ParentEduc
/PARTIALPLOT ALL
/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 PVTSTD1
/METHOD=ENTER H1GI1M H1GI1Y BIO_SEX BW PA12
/METHOD=ENTER BW_ParentEduc
/PARTIALPLOT ALL
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

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

USE ALL.
COMPUTE filter_$=(ZPVTSTD3L>-3).
VARIABLE LABELS filter_$ ‘ZPVTSTD3L>-3 (FILTER)’.
VALUE LABELS filter_$ 0 ‘Not Selected’ 1 ‘Selected’.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

MEANS TABLES=AH_PVT_Longitudinal_L3 AH_PVT_Cross_Sectional_W3 BY ParEduc3 BY BW
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=AH_PVT_Longitudinal_L3 AH_PVT_Cross_Sectional_W3 BY BW
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=AH_PVT_Longitudinal_L3 AH_PVT_Cross_Sectional_W3
/CELLS MEAN COUNT STDDEV.

WEIGHT BY GSWGT3.

USE ALL.
COMPUTE filter_$=(ZAH_PVT>-3).
VARIABLE LABELS filter_$ ‘ZAH_PVT>-3 (FILTER)’.
VALUE LABELS filter_$ 0 ‘Not Selected’ 1 ‘Selected’.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

MEANS TABLES=AH_PVT_W1 AH_PVT_Cross_Sectional_W1 BY ParEduc3 BY BW
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=AH_PVT_W1 AH_PVT_Cross_Sectional_W1 BY BW
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=AH_PVT_W1 AH_PVT_Cross_Sectional_W1
/CELLS MEAN COUNT STDDEV.

USE ALL.
COMPUTE filter_$=(ZPVTSTD3L>-3).
VARIABLE LABELS filter_$ ‘ZPVTSTD3L>-3 (FILTER)’.
VALUE LABELS filter_$ 0 ‘Not Selected’ 1 ‘Selected’.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

MEANS TABLES=AH_PVT_Longitudinal_L3 AH_PVT_Cross_Sectional_W3 BY ParEduc3 BY BW
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=AH_PVT_Longitudinal_L3 AH_PVT_Cross_Sectional_W3 BY BW
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=AH_PVT_Longitudinal_L3 AH_PVT_Cross_Sectional_W3
/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 PVTSTD3C
/METHOD=ENTER CALCAGE3 BIO_SEX3 BW PA12
/METHOD=ENTER BW_ParentEduc
/PARTIALPLOT ALL
/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 PVTSTD3L
/METHOD=ENTER CALCAGE3 BIO_SEX3 BW PA12
/METHOD=ENTER BW_ParentEduc
/PARTIALPLOT ALL
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

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

WEIGHT OFF.

FILTER OFF.
USE ALL.
EXECUTE.

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