lab 5 instruction. a collection of statistical methods to compare several groups according to their...

30
Lab 5 instruction

Upload: garry-thomas

Post on 13-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Lab 5 instruction

Page 2: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

a collection of statistical methods to compare several groups according to their means on a quantitative response variable

Two-Way ANOVA

two factors are usedconsider “main effect” and “interaction effect”

Page 3: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Response: Blood Alcohol Content (BAC) Factors:

◦ Gender(GEN) ◦ Alcohol Consumption (ALC)

Factor levels:◦ GEN: 1=Male; 0=Female◦ ALC: 1=1 drink; 2=2 drinks; 4=4 drinks

Main effect of GEN, main effect of ALC, and their interaction

ExampleExample

Page 4: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Table of marginal means (contingency table)

In SPSS: Analyze Compare Means Means

/Or General linear models descriptive stat

Explore the difference in average response across both factors.

Page 5: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Response: in Dependent list

Factors: in independent list of two seperate layers

e.g. Table of marginal means (contingency table)

Page 6: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

e.g. Table of marginal means (contingency table)

Interpret

Page 7: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Plots of marginal means (profile plot)

In SPSS:

Graphs legacy dialogs Line multiple

/Or GLM univariate (plots)

Explore the difference in average response across both factors.

Page 8: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Profile plot with lines representing gender

e.g. Plot of marginal means (profile plot)

Page 9: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Interpretation: ◦ 6 points ◦ Effect of gender◦ Effect of drink

consumption◦ Interaction

(parallel or crossed)

e.g. Plot of marginal means (profile plot)

Page 10: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Clustered boxplot

In SPSS:

Graphs legacy dialogs Boxplot Clustered

Explore the difference in average response across both factors.

Page 11: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Clustered boxplot with clusters defined by gender

e.g. Clustered boxplot

Page 12: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

e.g. Clustered boxplot

Page 13: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

General Linear Model (GLM)-Assumptions

Independent samples

Normality: ◦ Boxplot◦ QQ plot

Equal standard deviation (variance):◦ Boxplot◦ Summary statistics (rule of thumb: the ratio of the largest

s.d. over the smallest s.d. is less than 2)

Page 14: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

General Linear Model (GLM)

Univariate GLM is the general linear model now often used to implement such essential statistical procedures as regression and ANOVA. In particular, the procedure can be used to carry out two-way analysis of variance.

Procedure: Analyze General Linear Model Univariate

(defaulted: model with Interactions)

Page 15: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

GLM: Non-additive model output

Page 16: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

In columns “SS” and “df”◦ Corrected total = corrected model + error◦ Corrected model=GEN + ALC + GEN*ALC

The column “F” contains the value of the f statistic for each effect. The value of F is computed as follows:

GLM: Non-additive model output

Page 17: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

GLM: Non-additive model output

Hypothesis test : no interaction between GEN and ALC

H0

Page 18: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Equivalent to the regression Equivalent to the regression models:models:

H0 :4 5 0

HA : not both are zeros

Since the interaction term is not significant, we tend to modify the model.the model without the interaction term: additive model

Page 19: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

GLM: Define additive model

Page 20: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

GLM: Additive model output & equivalent regression model

42),|(

),|(

3210

0

alcalcgenALCGENBAC

ALCGENBAC

Page 21: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

GLM: Additive model output & equivalent regression model

42),|(

42),|(

3210

320

alcalcgenALCGENBAC

alcalcALCGENBAC

Page 22: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

GLM: Additive model output & equivalent regression model

42),|(

),|(

3210

10

alcalcgenALCGENBAC

genALCGENBAC

Page 23: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

GLM - Options

Model : define the model, Include intercept or not

Contrasts: The linear combination of the level means

Profile Plots: the plot of estimated means

Post Hoc

Save

Options

Page 24: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Profile Plots: different from the one obtained with line chart

This plots estimated means form the model

GLM - Options

Page 25: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Define dummy variables

Write down estimated model equation

Use extra-sum-of-squares F-test for testing interaction term

Interpret meaning of estimated coefficient, t-test on coefficients and their 95% CI

Equivalent regression models and tests

Page 26: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

estimated regression model with interaction term (full non-additive model)

Equivalent regression models and tests

Page 27: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

estimated regression model with NO interaction term (additive model)

Equivalent regression models and tests

Page 28: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Construct extra-of-sum F-test use the above two ANOVA tables,

In the regression model with NO interaction term, interpret meaning of , and its CI.

Is “GEN” effective in predicting BAC? (t-test on )

Equivalent regression models and tests

1

1

Page 29: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Linear combination of mean difference in BAC for male V.S. female

Substitute ’s by corresponding ’s

Note on Q3 (b)

33421421 fffmmm

Y

Page 30: Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way

Rate of increase in mean BAC for an increase in drinks consumption

Thus, in Q3 (c)

◦ rate (1to2) = , rate (2to4) =

In Q7 (c)◦ rate (1to2) = , rate (2to4) =

Note on Q3 (c) and Q7 (c)

2

3 2

2

1212

2424