general linear model. recall dummy coding dummy coding 0s and 1s –k-1 predictors will go into the...

15
General Linear Model

Upload: patience-cameron

Post on 18-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

General Linear Model

Page 2: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

Recall Dummy Coding

• Dummy coding• 0s and 1s

– k-1 predictors will go into the regression equation leaving out one reference category (e.g. control)

• Coefficients will be interpreted as change with respect to the reference variable (the one with all zeros)– In this case group 3

Group D1 D2

1 1 0

2 0 1

3 0 0

Page 3: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

General Equations

• When assumptions are met, average error, e = 0

• In the end we can see the intercept as the mean for Group 3, the reference group; and the coefficients for the coded variables are the mean difference between that group’s mean and the reference group mean

00

10

01

2122113

22122112

12122111

DD

DD

DD

322

311

3

Page 4: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

The Structural Model

• Generally we write the structural model for a One-way ANOVA where a person’s score in group j is a function of the grand mean of Y, the effect of being in group j, and error

• The null hypothesis is that the coefficients are zero, which is equivalent to saying the means are equal

ijjijy

Page 5: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

The Structural Model

• Using deviation regressors, in which the coding weights are constrained to sum to 0, tests this explicitly

• Here our reference group gets -1 for each variable

Group (α1)

D1

(α2)

D2

1 1 0

2 0 1

3 -1 -1

Page 6: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

General Equations

• From before

• The prediction for any group is equivalent to the grand mean of Y plus the effect of being in that group

• In other words, for each group member the predicted value is the mean for that group

212122113

22122112

12122111

01:3Group

10:2Group

01:1Group

DD

DD

DD

ijjijy

Page 7: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

Factorial Design

• Recall for the general one-way anova

• Where: – μ = grand mean = effect of Treatment A (μa – μ)

– ε = within cell error

• So a person’s score is a function of the grand mean, the treatment mean, and within cell error

( )ijk i k ijY

Page 8: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

Population main effect associated with the treatment Aj (first factor): jj

Population main effect associated with treatment Bk (second factor): kk

The interaction is defined as , the joint effect of treatment levels j and k (interaction of and ) so the linear model is:

ijkjkkjijk ey )(

jk)(

Each person’s score is a function of the grand mean, the treatment means, and their interaction (plus w/in cell error).

Effects for 2-way

Page 9: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

The general linear model

• The interaction is a residual:

• Plugging in and leads to:

kjjkjk )(

kjjkjk)(

Page 10: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

( )ijk i j k ijijY

0 1 2Treatment A. :

pH

0 1 2Treatment B. :

qH

0 11 12Interaction. :

pqH

Statistical Hypothesis:

Statistical Model:

GLM Factorial ANOVA

The interaction null is that the cell means do not differ significantly (from the grand mean) outside of the main effects present, i.e. that this residual effect is zero

Page 11: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

Comparison to regression• Data using deviation coding• ANOVA output top with bold correlates to

the regression output using an interaction product term1

F1 F2 DV1.00 -1.00 1.001.00 -1.00 2.001.00 -1.00 1.00-1.00 -1.00 2.00-1.00 -1.00 3.00-1.00 -1.00 2.001.00 1.00 4.001.00 1.00 3.001.00 1.00 4.00-1.00 1.00 1.00-1.00 1.00 3.00-1.00 1.00 2.00

Model Summary

.827a .684 .566 .70711Model1

R R SquareAdjustedR Square

Std. Error ofthe Estimate

Predictors: (Constant), interact, fact2, fact1a.

ANOVAb

8.667 3 2.889 5.778 .021a

4.000 8 .500

12.667 11

Regression

Residual

Total

Model1

Sum ofSquares df Mean Square F Sig.

Predictors: (Constant), interact, fact2, fact1a.

Dependent Variable: dvb.

Coefficientsa

2.333 .204 11.431 .000

.167 .204 .162 .816 .438

.500 .204 .487 2.449 .040

.667 .204 .649 3.266 .011

(Constant)

fact1

fact2

interact

Model1

B Std. Error

UnstandardizedCoefficients

Beta

StandardizedCoefficients

t Sig.

Dependent Variable: dva.

Page 12: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

Repeated Measures

• One way design for Repeated Measures has two effects

• Effect of the treatment at a particular time

• Effect of the between subjects factor

Page 13: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

Repeated Measures

• The basic linear model thus has 2 ‘main’ effects though typically only one is of interest

• The interaction that would normally be present in such a situation is relegated to error variance

• So the error variance equals the subject x treatment interaction + random error

ee

eyi

*

Page 14: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

Factorial Repeated Measures

• With Factorial RM we have unique error for each main effect and interaction

ee

eyi

Page 15: General Linear Model. Recall Dummy Coding Dummy coding 0s and 1s –k-1 predictors will go into the regression equation leaving out one reference category

Mixed Design

• β here is the repeated measure

• The RM factor and interaction are tested on the same error term (in parentheses)

eyi

eeffectsgroupsWithin

effectgroupsBetween