* ************************************************

* SPSS RUN 4—ONEWAY AND TWOWAY

* FACTORIAL ANOVA

* LOGISTIC REGRESSION

* *************************************************.

GET FILE='c:\temp\werner.sav'.

FREQUENCIES

VARIABLES=agegroup .

*------Compare Means--One-Way Anova.

ONEWAY

chol BY agegroup

/POLYNOMIAL= 1

/STATISTICS DESCRIPTIVES HOMOGENEITY

/PLOT MEANS

/MISSING ANALYSIS

/POSTHOC = TUKEY BONFERRONI ALPHA(.05).

*------General Linear Model--Univariate for twoway anova--GLM can also be used for oneway.

UNIANOVA

chol BY agegroup pill

/METHOD = SSTYPE(3)

/INTERCEPT = INCLUDE

/POSTHOC = agegroup ( TUKEY )

/PLOT = PROFILE( agegroup*pill )

/PRINT = DESCRIPTIVE HOMOGENEITY

/CRITERIA = ALPHA(.05)

/DESIGN = agegroup pill agegroup*pill .

*------General Linear Model--Include Covariates in Model.

UNIANOVA

chol BY agegroup pill WITH height weight

/METHOD = SSTYPE(3)

/INTERCEPT = INCLUDE

/SAVE = PRED SEPRED RESID ZRESID

/PRINT = DESCRIPTIVE HOMOGENEITY

/CRITERIA = ALPHA(.05)

/DESIGN = height weight agegroup pill agegroup*pill .

*------Check Residuals for Normality -- Descriptive Statistics---Explore.

EXAMINE

VARIABLES=zre_1

/PLOT BOXPLOT STEMLEAF HISTOGRAM NPPLOT

/COMPARE GROUP

/STATISTICS DESCRIPTIVES

/CINTERVAL 95

/MISSING LISTWISE

/NOTOTAL.

*------Scatterplot of Residuals vs. Predicted Value.

GRAPH

/SCATTERPLOT(BIVAR)=pre_1 WITH zre_1

/MISSING=LISTWISE .

*------Setup for LOGISTIC REGRESSION.

RECODE

chol

(Lowest thru 249=0) (250 thru Highest=1) INTO hichol .

EXECUTE.

FREQUENCIES

VARIABLES=hichol .

CROSSTABS

/TABLES=agegroup BY hichol

/FORMAT= AVALUE TABLES

/STATISTIC=CHISQ

/CELLS= COUNT ROW.

*------Regression--Binary Logistic.

LOGISTIC REGRESSION VAR=hichol

/METHOD=ENTER acid age alb calcium height weight

/SAVE PRED

/CLASSPLOT

/CRITERIA PIN(.05) POUT(.10) ITERATE(20) CUT(.5) .

*------AGE is Categorical.

LOGISTIC REGRESSION VAR=hichol

/METHOD=ENTER acid alb calcium height weight agegroup

/CONTRAST (agegroup)=Indicator(1)

/SAVE PRED

/CLASSPLOT

/CRITERIA PIN(.05) POUT(.10) ITERATE(20) CUT(.5) .

LOGISTIC REGRESSION VAR=hichol

/METHOD=FSTEP(LR) acid alb calcium height weight agegroup

/CONTRAST (agegroup)=Indicator(1)

/CLASSPLOT

/PRINT=CI(95)

/CRITERIA PIN(.05) POUT(.10) ITERATE(20) CUT(.5) .

LOGISTIC REGRESSION VAR=hichol

/METHOD=ENTER age calcium acid

/SAVE PRED

/CRITERIA PIN(.05) POUT(.10) ITERATE(20) CUT(.5) .

*------Graphs.

COMPUTE xbeta1 = -15.5828+.0687*age+1.1046*calcium+.3493*acid .

EXECUTE .

GRAPH

/SCATTERPLOT(BIVAR)=xbeta1 WITH pre_4

/MISSING=LISTWISE .

COMPUTE logit = ln(pre_4/(1-pre_4)) .

EXECUTE .

GRAPH

/SCATTERPLOT(BIVAR)=xbeta1 WITH logit

/MISSING=LISTWISE .

Frequencies

Oneway—Oneway Anova

Post Hoc Tests

Homogeneous Subsets

Means Plots

Univariate Analysis of Variance

Post Hoc Tests

AGEGROUP

Homogeneous Subsets

Profile Plots

Univariate Analysis of Variance

Explore

Standardized Residual for CHOL

Standardized Residual for CHOL Stem-and-Leaf Plot

Frequency Stem & Leaf

1.00 -2 . 7

1.00 -2 . 3

7.00 -1 . 5555777

22.00 -1 . 0000111122222222233344

26.00 -0 . 55555566666777777778888889

37.00 -0 . 0000111111111111222222233333333444444

30.00 0 . 000000000111111222233333333444

29.00 0 . 55555566666666777777888899999

18.00 1 . 000000011122233444

8.00 1 . 55668899

1.00 2 . 0

2.00 Extremes (>=2.9)

Stem width: 1.00

Each leaf: 1 case(s)

Graph

Frequencies

Crosstabs

Logistic Regression

Block 0: Beginning Block

Block 1: Method = Enter

Step number: 1

Observed Groups and Predicted Probabilities

16  

 

 

F  

R 12  

E  H 

Q  L 

U  L H H 

E 8  L L L H H 

N  L L L HH H 

C  L L L HH H HL H 

Y  LLL LHLL H LL H H HH 

4  LLLLLLLL HLHLL LH H H H HH H 

 LLLLLLLLLHLLLLLH LH L HHHHH L H L HH H 

 LLLLLLLLLLHLLLLLLHLLHLHLHHHHLHLHH L LH HL H H 

 HLLLLLLLLLLLLLLLLLLLLLLLLLHLLLLLHLHLLHLHLHHHL LHHH H 

Predicted 

Prob: 0 .25 .5 .75 1

Group: LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

Predicted Probability is of Membership for HIGH

The Cut Value is .50

Symbols: L - LOW

H - HIGH

Each Symbol Represents 1 Case.

Logistic Regression

Block 0: Beginning Block

Block 1: Method = Enter

Step number: 1

Observed Groups and Predicted Probabilities

16  

 

 

F  

R 12  

E  

Q  H 

U  L HH 

E 8  L LL 

N  LL LL HHH H 

C  LL LLLL HHHH L 

Y  LLLLLLL LLHH HL H H 

4  LLLLLLL HLLHL HL HHHH H H H H 

 LLLLLLLHHLLLL HLL HH LHHH H L H H HH H 

 LLLLLLLLHLLLLL LLL LLH LHLH HHHLLL HHHH HLHH H 

 HLLLLLLLLLLLLLLLLLLHLLLHHLLLLHLLLLLLLHLHLLHLLH H H H 

Predicted 

Prob: 0 .25 .5 .75 1

Group: LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

Predicted Probability is of Membership for HIGH

The Cut Value is .50

Symbols: L - LOW

H - HIGH

Each Symbol Represents 1 Case.

Logistic Regression

Block 0: Beginning Block

Block 1: Method = Forward Stepwise (Likelihood Ratio)

Step number: 1

Observed Groups and Predicted Probabilities

80  

 

 

F  

R 60  H H 

E  H H H 

Q  L H H 

U  L L H 

E 40  L L H 

N  L L H 

C  L L H 

Y  L L H 

20  L L L 

 L L L 

 L L L 

 L L L 

Predicted 

Prob: 0 .25 .5 .75 1

Group: LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

Predicted Probability is of Membership for HIGH

The Cut Value is .50

Symbols: L - LOW

H - HIGH

Each Symbol Represents 5 Cases.

Step number: 2

Observed Groups and Predicted Probabilities

16  

 H 

 H 

F  H 

R 12  H H 

E  HL H 

Q  HL HH H 

U  LL HL HH H H 

E 8  LL HL HHL H H 

N  LL LL LHL L H H 

C  LL LL LHL LH H H 

Y  LL LL LHL LL H L H H H 

4  LLHLLL LLL LL H L H H L H H 

 LLLLLLL LLL LL L L HH H HL H HL H HH H 

 LLLLLLL LLL LL LL L LLHHLHHL H HL HL HLH HH 

 LLLLLLLL LLL LL LLHL LLHLLLLL LHHL LL HLH LLH H 

Predicted 

Prob: 0 .25 .5 .75 1

Group: LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

Predicted Probability is of Membership for HIGH

The Cut Value is .50

Symbols: L - LOW

H - HIGH

Each Symbol Represents 1 Case.

Step number: 3

Observed Groups and Predicted Probabilities

16  

 

 

F  

R 12  

E  

Q  H 

U  L HH 

E 8  L L LH H 

N  L LHLL H H H 

C  LLLLLL HHH HH H 

Y  LLLLLL HHHLHL H H H 

4  HLLLLLLLHHHHLHL L L H H H H 

 LLLLLLLLLLLLLLLH L L H H HH L HH HHH HH 

 LLLLLLLLLLLLLLLLHL LLH LHLLHLHHL LHH LH HHHH 

 LLLLLLLLLLLLLLLLLLL LLL LLLLHLHLL LLHHLHLLHHHLH H H 

Predicted 

Prob: 0 .25 .5 .75 1

Group: LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

Predicted Probability is of Membership for HIGH

The Cut Value is .50

Symbols: L - LOW

H - HIGH

Each Symbol Represents 1 Case.

Logistic Regression

Block 0: Beginning Block

Block 1: Method = Enter

Graph

Graph

1