Beruflich Dokumente
Kultur Dokumente
𝑌 =𝜇+𝛼+𝜀
Score = Grand mean + Independent variable + Error
The basic idea is that everyone in the population has the same
score (the grand mean) that is changed by the effects of an
independent variable (A) plus just random noise (error).
Some levels of IV raise scores from the GM, other levels lower
scores from the GM and yet others have no effect.
General Linear Model
General form:
𝑌𝑖 = 𝛽𝑜 + 𝛽1 𝑋1 + 𝛽2 𝑋2 + ⋯ . 𝛽𝑘 𝑋𝑘 + 𝜀
Where:
𝛽𝑜 =Y-intercept
𝛽1 = Slope of Y with variable 𝑋1 .
𝛽2 = Slope of Y with variable 𝑋1 .
.
.
𝛽𝑘 = Slope of Y with variable 𝑋𝑘 .
𝜀 = random error in Y for observation i.
Assumptions for a GLM
22 2 290 124140
−1.0621
41 4.5 500 𝛽= 𝑋𝑋′ −1 ′
𝑋 𝑌 = 8.6522
0.0070
34 3.5 350
12 1.5 250 𝑌𝑖 = 𝛽𝑜 + 𝛽1 𝑋1 + 𝛽2 𝑋2
23 3 300
𝒀 = −𝟏. 𝟎𝟔𝟐 + 𝟖. 𝟔𝟓𝟐𝑿𝟏 + 𝟎. 𝟎𝟎𝟕𝑿𝟐
Develop a prediction equation.
Using MATLAB:
Using Microsoft Excel:
ANOVA Summary Table for
the Overall F test
Source df SS MS F-test
𝑆𝑆𝑅 𝑀𝑆𝑅
𝑀𝑆𝑅 = 𝐹=
Regression k SSR 𝑘 𝑀𝑆𝐸
𝑆𝑆𝐸
𝑀𝑆𝐸 =
Error n–k-1 SSE 𝑛−𝑘−1
• Hypotheses:
𝐻𝑜 : 𝛽1 = ⋯ . = 𝛽𝑘 = 0 (No linear relationship bet DV and IV).
𝐻𝑖 : At least one 𝛽 ≠ 0 (linear relationship bet DV and IV)
ANOVA Table:
2
𝑆𝑢𝑚 𝑜𝑓 𝑆𝑞𝑢𝑎𝑟𝑒𝑠 𝑟𝑒𝑔𝑟𝑒𝑠𝑠𝑖𝑜𝑛, 𝑆𝑆𝑅
𝑟 =
𝑇𝑜𝑡𝑎𝑙 𝑠𝑢𝑚 𝑜𝑓 𝑠𝑞𝑢𝑎𝑟𝑒, 𝑆𝑆𝑇
a1 a2
Case Score Case Score
s1 5 s6 5
s2 5 s7 5
s3 5 s8 5
s4 5 s9 5
s5 5 s10 5
General Linear Model (GLM)
Then we add in the effect of A (a1 adds 2 points and a2
subtracts 2 points).
a1 a2
Case Score Case Score
s1 5+2=7 s6 5–2=3
s2 5+2=7 s7 5–2=3
s3 5+2=7 s8 5–2=3
s4 5+2=7 s9 5–2=3
s5 5+2=7 s10 5–2=3
Ya1 35 Ya2 15
a1 245
Y 2
a2 45
Y 2
Ya1 7 Ya3 3
General Linear Model (GLM)
Changes produced by the treatment represent deviations
around the GM.
n (Y j GM ) n[(7 5) (3 5) ]
2 2 2
Ya1 7 Ya3 3 Y 5
General Linear Model (GLM)
Now if we calculate the variance for each group:
Y 2
( Y ) 2
251
35 2
a1
sN2 1 N 5 1.5
N 1 4
Ya2
2 ( Y ) 2
51
152
sN2 1 N 5 1.5
N 1 4
The average variance in this case is also going to be 1.5
(1.5 + 1.5 / 2)
General Linear Model (GLM)
We can also calculate the total variability in the data
regardless of treatment group.
Y
2 ( Y ) 2
302
50 2
sN2 1 N 10 5.78
N 1 9
Y
2 ( Y ) 2
302
50 2
sN2 1 N 10 5.78
N 1 9
Y ij GM Yij Y j Y j GM
Y GM n Y j GM Yij Y j
2 2 2
ij
i j j i j
SStotal SSbg SS wg
SStotal SS A SS S / A
Analysis – deviation approach
Yij GM Yj GM Yij Y j
2 2 2
A Score
9 16 4
7 4 0
a1 6 1 (7 – 5)2 = 4 1
7 4 0
6 1 1
3 4 0
1 16 4
a2 3 4 (3 – 5)2 = 4 0
4 1 1
4 1 1
Y 50
Y 2
302 52 8 12
Y 5 n 5(8) 40
Analysis – deviation approach
Yij GM Yj GM Yij Y j
2 2 2
A Score
9 16 4
7 4 0
a1 6 1 (7 – 5)2 = 4 1
7 4 0
6 1 1
3 4 0
1 16 4
a2 3 4 (3 – 5)2 = 4 0
4 1 1
4 1 1
Y 50
Y 2
302 52 8 12
Y 5 n 5(8) 40
Analysis – deviation approach
degrees of freedom
DFtotal = N – 1 = 10 -1 = 9
DFA = a – 1 = 2 – 1 = 1
DFS/A = a(S – 1) = a(n – 1) = an – a =
N – a = 2(5) – 2 = 8
Variance or Mean square
MStotal = 52/9 = 5.78
MSA = 40/1 = 40
MSS/A = 12/8 = 1.5
Test statistic
F = MSA/MSS/A = 40/1.5 = 26.67
Critical value is looked up with dfA, dfS/A and alpha. The test is
always non-directional.
Analysis – deviation approach
ANOVA summary table
Source SS df MS F
A 40 1 40 26.67
S/A 12 8 1.5
Total 52 9
Analysis – computational approach
Equations
Y
2
2
T
SSY SST Y 2
Y
2
N an
a
2
2
T
j
SS A
n an
a
2
SS S / A Y
2 j
n
Under each part of the equations, you divide by the number
of scores it took to get the number in the numerator
Analysis – computational approach
Analysis of sample problem
2
50
SST 302 52
10
35 15 50
2 2 2
SS A 40
5 10
35 15
2 2
SS S / A 302 12
5
Analysis – regression approach
Levels of A Cases Y X YX
S1 9 1 9
S2 7 1 7
a1 S3 6 1 6
S4 7 1 7
S5 6 1 6
S6 3 -1 -3
S7 1 -1 -1
a2 S8 3 -1 -3
S9 4 -1 -4
S10 4 -1 -4
Sum 50 0 20
Squares Summed 302 10
N 10
Mean 5
Analysis – regression approach
Y = a + bX + e
e = Y – Y’
• Sums of squares
Y
2
502
SS (Y ) Y 2 302 52
N 10
X
2
2
0
SS ( X ) X 2
10 10
N 10
( Y )( X ) (50)(0)
SP(YX ) YX 20 20
N 10
Analysis – regression approach
• Slope
( Y )( X )
YX N SP(YX ) 20
b 2
2
X SS ( X ) 10
N
X 2
• Intercept
a Y bX 5 2(0) 5
Analysis – regression approach
Y ' a bX
For a1 :
Y ' 5 2(1) 7
For a 2 :
Y ' 5 2(1) 3
Analysis – regression approach
Degrees of freedom
df(reg.) = # of predictors
df(total) = number of cases – 1
df(resid.) = df(total) – df(reg.) =
9–1=8
Statistical Inference and the F-test
Any type of measurement will include a certain
amount of random variability.