More income for more happiness ? Yes, but… (NLSY97, SPSS syntax)

Original article here. (Again, the use of weights versus no weights does not affect the results.)

IF R0538700=2 BW=1.
IF R0538700=1 and R1482600=4 BW=2.

IF R0538700=2 BH=1.
IF R1482600=2 BH=2.

IF R1482600=2 HW=1.
IF R0538700=1 and R1482600=4 HW=2.

IF R0538700=2 BHW=1.
IF R1482600=2 BHW=2.
IF R0538700=1 and R1482600=4 BHW=3.

COMPUTE DONATED=MEAN(S6317700, S6317800, T0740000, T0740100).

COMPUTE COMMUNITY_PARTICIPATION=MEAN(T1069200, T1069201, T1069202, T1069203).

COMPUTE LIBERTARIANISM=MEAN(S8646900, S8647000, S8647100, S8647200, S8647300, S8647400, S8647500, S8647600, S8647700, S8647800).

COMPUTE RISK_TAKING=MEAN(T6216200, T6216300, T6216301, T6216302, T6216303, T6216304, T6216305, T6216306, T6216307).

COMPUTE ATTEND_WORSHIP_SERVICES=MEAN(R4893400, R6520100, S0919300, S2987800, S4681700, S6316700, S8331500, T0739400, T2781700, T4495000, T6143400).

COMPUTE HEALTH_AVG=MEAN(R0320600, R2164000, R3481900, R4880100, R6497500, S1225000, S3302500, S4919500, S6661100, S8644200, T1049500, T3144600, T4562200, T6206400).

COMPUTE SQRT_health=SQRT(HEALTH_AVG).

COMPUTE R_INCOME=MEAN(S6501000, S8496500, T0889800, T3003000, T4406000, T6055500).

COMPUTE sqrtRINCOME=SQRT(R_INCOME+1).
VARIABLE LABELS sqrtRINCOME ‘square root of respondent income’.

RECODE Z9083800 (1 thru 20=COPY) (ELSE=SYSMIS) INTO RGRADE.

COMPUTE FOLLOWING_RULES_2008=T3162700*(-1).
COMPUTE BREAKING_SCHOOL_RULES_2008=T3162701*(-1).
COMPUTE FOLLOWING_RULES_2010=T6216500*(-1).
COMPUTE BREAKING_SCHOOL_RULES_2010=T6216501*(-1).
COMPUTE LAW_ABIDINGNESS=MEAN(FOLLOWING_RULES_2008, BREAKING_SCHOOL_RULES_2008, T3162702, T3162703, FOLLOWING_RULES_2010, BREAKING_SCHOOL_RULES_2010, T6216502, T6216503).

COMPUTE HARD_WORKER_2008=T3162600*(-1).
COMPUTE AMOUNT_OF_WORK_2008=T3162601*(-1).
COMPUTE HARD_WORKER_2010=T6216400*(-1).
COMPUTE AMOUNT_OF_WORK_2010=T6216401*(-1).
COMPUTE HARD_WORKING=MEAN(HARD_WORKER_2008, AMOUNT_OF_WORK_2008, T3162602, T3162603, HARD_WORKER_2010, AMOUNT_OF_WORK_2010, T6216402, T6216403).

COMPUTE QUARRELSOME=T3162501*(-1).
COMPUTE EASILY_UPSET=T3162503*(-1).
COMPUTE CARELESS=T3162507*(-1).

COMPUTE SOCIABILITY_INDEX=MEAN(QUARRELSOME, EASILY_UPSET, T3162502, T3162505, T3162506, T3162508).
COMPUTE NO_SOCIABILITY=SOCIABILITY_INDEX*(-1).

COMPUTE CALM_2000=R4893700*(-1).
COMPUTE HAPPY_2000=R4893900*(-1).
COMPUTE HAPPINESS_2000=MEAN(R4893600, R4893800, R4894000, CALM_2000, HAPPY_2000).
COMPUTE CALM_2002=S0920900*(-1).
COMPUTE HAPPY_2002=S0921100*(-1).
COMPUTE HAPPINESS_2002=MEAN(S0920800, S0921000, S0921200, CALM_2002, HAPPY_2002).
COMPUTE CALM_2004=S4682000*(-1).
COMPUTE HAPPY_2004=S4682200*(-1).
COMPUTE HAPPINESS_2004=MEAN(S4681900, S4682100, S4682300, CALM_2004, HAPPY_2004).
COMPUTE CALM_2006=S8332400*(-1).
COMPUTE HAPPY_2006=S8332600*(-1).
COMPUTE HAPPINESS_2006=MEAN(S8332300, S8332500, S8332700, CALM_2006, HAPPY_2006).
COMPUTE CALM_2008=T2782700*(-1).
COMPUTE HAPPY_2008=T2782900 *(-1).
COMPUTE HAPPINESS_2008=MEAN(T2782600, T2782800, T2783000, CALM_2008, HAPPY_2008).
COMPUTE CALM_2010=T6143800*(-1).
COMPUTE HAPPY_2010=T6144000*(-1).
COMPUTE HAPPINESS_2010=MEAN(T6143700, T6143900, T6144100, CALM_2010, HAPPY_2010).COMPUTE HAPPINESS=MEAN(HAPPINESS_2000, HAPPINESS_2002, HAPPINESS_2004, HAPPINESS_2006, HAPPINESS_2008, HAPPINESS_2010).FREQUENCIES VARIABLES=HEALTH_AVG

/FORMAT=NOTABLE
/HISTOGRAM NORMAL
/ORDER=ANALYSIS.

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

COMPUTE SCALEDWEIGHTS1=R1236201*1532/196069195.
EXECUTE.
WEIGHT BY SCALEDWEIGHTS1.

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT HAPPINESS
/METHOD=ENTER R0536300 R0536402 ATTEND_WORSHIP_SERVICES
/METHOD=ENTER sqrtRINCOME RGRADE R9829600
/METHOD=ENTER HEALTH_AVG
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

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

COMPUTE SCALEDWEIGHTS2=R1236201*1178/155953268.
EXECUTE.
WEIGHT BY SCALEDWEIGHTS2.

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT HAPPINESS
/METHOD=ENTER R0536300 R0536402 ATTEND_WORSHIP_SERVICES
/METHOD=ENTER sqrtRINCOME RGRADE R9829600
/METHOD=ENTER HEALTH_AVG
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

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

COMPUTE SCALEDWEIGHTS3=R1236201*3199/935903800.
EXECUTE.
WEIGHT BY SCALEDWEIGHTS3.

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT HAPPINESS
/METHOD=ENTER R0536300 R0536402 ATTEND_WORSHIP_SERVICES
/METHOD=ENTER sqrtRINCOME RGRADE R9829600
/METHOD=ENTER HEALTH_AVG
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

WEIGHT BY R1236201.

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

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT HEALTH_AVG
/METHOD=ENTER R0536300 R0536402 ATTEND_WORSHIP_SERVICES
/METHOD=ENTER sqrtRINCOME RGRADE R9829600
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

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

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT HEALTH_AVG
/METHOD=ENTER R0536300 R0536402 ATTEND_WORSHIP_SERVICES
/METHOD=ENTER sqrtRINCOME RGRADE R9829600
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

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

REGRESSION
/DESCRIPTIVES MEAN STDDEV CORR SIG N
/MISSING LISTWISE
/STATISTICS COEFF OUTS R ANOVA CHANGE ZPP
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN
/DEPENDENT HEALTH_AVG
/METHOD=ENTER R0536300 R0536402 ATTEND_WORSHIP_SERVICES
/METHOD=ENTER sqrtRINCOME RGRADE R9829600
/SCATTERPLOT=(*ZRESID ,*ZPRED)
/RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

FILTER OFF.
USE ALL.
EXECUTE.

WEIGHT OFF.

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