Gender and Race Differences in the Wordsum GSS : Test of Psychometric Bias with Logistic Regression (SPSS syntax)

See the related post here.

SET MXCELLS=9000.

RECODE worda (0=0) (1=1) (9=0) (ELSE=SYSMIS) INTO word_a.
RECODE wordb (0=0) (1=1) (9=0) (ELSE=SYSMIS) INTO word_b.
RECODE wordc (0=0) (1=1) (9=0) (ELSE=SYSMIS) INTO word_c.
RECODE wordd (0=0) (1=1) (9=0) (ELSE=SYSMIS) INTO word_d.
RECODE worde (0=0) (1=1) (9=0) (ELSE=SYSMIS) INTO word_e.
RECODE wordf (0=0) (1=1) (9=0) (ELSE=SYSMIS) INTO word_f.
RECODE wordg (0=0) (1=1) (9=0) (ELSE=SYSMIS) INTO word_g.
RECODE wordh (0=0) (1=1) (9=0) (ELSE=SYSMIS) INTO word_h.
RECODE wordi (0=0) (1=1) (9=0) (ELSE=SYSMIS) INTO word_i.
RECODE wordj (0=0) (1=1) (9=0) (ELSE=SYSMIS) INTO word_j.

RECODE wordsum (0 thru 10=COPY) (ELSE=SYSMIS) INTO wordsum.gss.
RECODE race (2=0) (1=1) (ELSE=SYSMIS) INTO race.gss.
RECODE sex (2=0) (1=1) (ELSE=SYSMIS) INTO sex.gss.

RECODE wordsum (0 thru 5=0) (6 thru 10=1) INTO wordsum_category2.
RECODE wordsum (0 thru 4=0) (5 thru 6=1) (7 thru 10=2) INTO wordsum_category3.

COMPUTE Wordsum_without_WordG=SUM(word_a, word_b, word_c, word_d, word_e, word_f, word_h, word_i, word_j).
COMPUTE Wordsum_all=SUM(word_a, word_b, word_c, word_d, word_e, word_f, word_g, word_h, word_i, word_j).

RECODE race (1=2) (2=1) (ELSE=SYSMIS) INTO BW.
VALUE LABELS BW 1 'blacks' 2 'whites'.
EXECUTE.

COMPUTE BW_wordsum=BW*wordsum.
COMPUTE SEX_wordsum=sex*wordsum.
SELECT IF(NOT MISSING(BW)) AND (NOT MISSING(age)) AND (NOT MISSING(sex)) AND (NOT MISSING(wordsum)).
RECODE wordsum (0 thru 2=1) (3=2) (4=3) (5=4) (6=5) (7=6) (8=7) (9=8) (10=9) INTO wordsum_cat9.
RECODE wordsum (0 thru 2=1) (3=2) (4=3) (5=4) (6=5) (7 thru 8=6) (9 thru 10=7) INTO wordsum_cat7.
EXECUTE.

WEIGHT BY wtssall.

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

COMPUTE Wordsum_TrueScore_Blacks=4.85+(0.73*(wordsum-4.85)).
EXECUTE.

USE ALL.
COMPUTE filter_$=(BW=2).
VARIABLE LABELS filter_$ ‘BW=2 (FILTER)’.
VALUE LABELS filter_$ 0 ‘Not Selected’ 1 ‘Selected’.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

COMPUTE Wordsum_TrueScore_Whites=6.23+(0.73*(wordsum-6.23)).
EXECUTE.

FILTER OFF.
USE ALL.
EXECUTE.

COMPUTE Wordsum_True=SUM(Wordsum_TrueScore_Blacks, Wordsum_TrueScore_Whites).

LOGISTIC REGRESSION VARIABLES word_a
/METHOD=ENTER wordsum
/METHOD=ENTER BW
/METHOD=ENTER BW_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_b
/METHOD=ENTER wordsum
/METHOD=ENTER BW
/METHOD=ENTER BW_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_c
/METHOD=ENTER wordsum
/METHOD=ENTER BW
/METHOD=ENTER BW_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_d
/METHOD=ENTER wordsum
/METHOD=ENTER BW
/METHOD=ENTER BW_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_e
/METHOD=ENTER wordsum
/METHOD=ENTER BW
/METHOD=ENTER BW_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_f
/METHOD=ENTER wordsum
/METHOD=ENTER BW
/METHOD=ENTER BW_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_g
/METHOD=ENTER wordsum
/METHOD=ENTER BW
/METHOD=ENTER BW_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_h
/METHOD=ENTER wordsum
/METHOD=ENTER BW
/METHOD=ENTER BW_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_i
/METHOD=ENTER wordsum
/METHOD=ENTER BW
/METHOD=ENTER BW_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_j
/METHOD=ENTER wordsum
/METHOD=ENTER BW
/METHOD=ENTER BW_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_1 BY BW
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_2 BY BW
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_3 BY BW
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_4 BY BW
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_5 BY BW
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_6 BY BW
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_7 BY BW
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_8 BY BW
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_9 BY BW
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_10 BY BW
/MISSING=LISTWISE.

COMPUTE PredictedScore1=SUM(PRE_1 to PRE_10).

GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PredictedScore1 BY BW
/MISSING=LISTWISE.

COMPUTE PredictedScore_without_WordG=SUM(PRE_1, PRE_2, PRE_3, PRE_4, PRE_5, PRE_6, PRE_8, PRE_9, PRE_10).

GRAPH
/SCATTERPLOT(BIVAR)=Wordsum_without_WordG WITH PredictedScore_without_WordG BY BW
/MISSING=LISTWISE.

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

DESCRIPTIVES VARIABLES=wordsum
/STATISTICS=MEAN STDDEV MIN MAX.

LOGISTIC REGRESSION VARIABLES word_a
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_b
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_c
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_d
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_e
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_f
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_g
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_h
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_i
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_j
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_11 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_12 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_13 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_14 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_15 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_16 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_17 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_18 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_19 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_20 BY sex
/MISSING=LISTWISE.

COMPUTE PredictedScore2=SUM(PRE_11 to PRE_20).
EXECUTE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PredictedScore2 BY sex
/MISSING=LISTWISE.

USE ALL.
COMPUTE filter_$=(BW=2).
VARIABLE LABELS filter_$ ‘BW=2 (FILTER)’.
VALUE LABELS filter_$ 0 ‘Not Selected’ 1 ‘Selected’.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

DESCRIPTIVES VARIABLES=wordsum
/STATISTICS=MEAN STDDEV MIN MAX.

LOGISTIC REGRESSION VARIABLES word_a
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_b
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_c
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_d
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_e
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_f
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_g
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_h
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_i
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

LOGISTIC REGRESSION VARIABLES word_j
/METHOD=ENTER wordsum
/METHOD=ENTER sex
/METHOD=ENTER SEX_wordsum
/SAVE=PRED
/CLASSPLOT
/PRINT=GOODFIT CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_21 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_22 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_23 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_24 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_25 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_26 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_27 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_28 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_29 BY sex
/MISSING=LISTWISE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PRE_30 BY sex
/MISSING=LISTWISE.

COMPUTE PredictedScore3=SUM(PRE_21 to PRE_30).
EXECUTE.
GRAPH
/SCATTERPLOT(BIVAR)=wordsum WITH PredictedScore3 BY sex
/MISSING=LISTWISE.

FILTER OFF.
USE ALL.
EXECUTE.

MEANS TABLES=word_a word_b word_c word_d word_e word_f word_g word_h word_i word_j BY BW BY sex
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=Wordsum_all wordsum Wordsum_without_WordG PredictedScore1 PredictedScore_without_WordG
BY BW
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=Wordsum_all wordsum Wordsum_without_WordG PredictedScore1 PredictedScore_without_WordG
BY BW BY wordsum_category2 wordsum_category3
/CELLS MEAN COUNT STDDEV.

MEANS TABLES=Wordsum Wordsum_all Wordsum_without_WordG BY degree BY BW
/CELLS MEAN COUNT STDDEV.

SORT CASES BY wordsum_cat9.
SPLIT FILE LAYERED BY wordsum_cat9.

MEANS TABLES=wordsum BY BW
/CELLS MEAN COUNT STDDEV.

CROSSTABS
/TABLES=word_a word_b word_c word_d word_e word_f word_g word_h word_i word_j BY BW
/FORMAT=AVALUE TABLES
/CELLS=COUNT
/COUNT ROUND CELL.

SORT CASES BY wordsum_cat7.
SPLIT FILE LAYERED BY wordsum_cat7.

MEANS TABLES=wordsum BY BW
/CELLS MEAN COUNT STDDEV.

CROSSTABS
/TABLES=word_a word_b word_c word_d word_e word_f word_g word_h word_i word_j BY BW
/FORMAT=AVALUE TABLES
/CELLS=COUNT
/COUNT ROUND CELL.

SPLIT FILE OFF.

WEIGHT OFF.

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