Professional Documents
Culture Documents
predictor variables
Examples of
qualitative predictor variables
Gender (male, female)
Smoking status (smoker, nonsmoker)
Socioeconomic status (poor, middle, rich)
An example
with one qualitative predictor
Weight (grams)
3500
3000
2500
34
35
36
37
38
39
40
Gestation (weeks)
41
42
Yi 0 1 x i1 2 x i 2 i
where
Yi is birth weight of baby i
xi1 is length of gestation of baby i
xi2 = 1, if mother smokes and xi2 = 0, if not
and the independent error terms i follow a normal
distribution with mean 0 and equal variance 2.
Yi 0 1 x i1 2 x i 2 i
If mother is a nonsmoker (xi2 = 0):
E Yi 0 1 x i1
E Yi ( 0 2 ) 1 x i1
Interpretation of the
regression coefficients
0
1
Weight (grams)
y 2390 143 x
3200
2700
y 2635 143 x
2200
34
35
36
37
38
39
Gestation (weeks)
40
41
42
E Yi ( 0 2 ) 1 x i1
Coef
-2389.6
143.100
-244.54
SE Coef
349.2
9.128
41.98
R-Sq = 89.6%
T
-6.84
15.68
-5.83
P
0.000
0.000
0.000
R-Sq(adj) = 88.9%
Coef
-2389.6
143.100
-244.54
SE Coef
349.2
9.128
41.98
R-Sq = 89.6%
T
-6.84
15.68
-5.83
P
0.000
0.000
0.000
R-Sq(adj) = 88.9%
SS
3348720
387070
3735789
MS
1674360
13347
F
125.45
P
0.000
3048.2
28.9
Coef
-2546.1
147.21
SE Coef
457.3
11.97
R-Sq = 91.5%
T
-5.57
12.29
P
0.000
0.000
R-Sq(adj) = 90.9%
DF
1
14
15
SS
1728172
160082
1888254
MS
1728172
11434
F
151.14
P
0.000
95.0% PI
(2811.3, 3284.2)
Coef
-2474.6
139.03
SE Coef
554.0
14.11
R-Sq = 87.4%
T
-4.47
9.85
P
0.001
0.000
R-Sq(adj) = 86.5%
SS
1554776
224310
1779086
MS
1554776
16022
F
97.04
P
0.000
95.0% PI
(2526.4, 3090.7)
E Y 0 1 x i1 2 x i 2 3 x i 3
where
Yi is birth weight of baby i
xi1 is length of gestation of baby i
xi2 = 1, if smokes and xi2 = 0, if not
Implication on X matrix
Y1
Y2
E Y Y3
Y4
Y
5
1
X 1
1
1
x i1
xi 2
xi 3
xi 4
xi 5
1
1
1
0
0
0
0
Yi 0 1 x i1 2 x i 2 i
where
Yi is birth weight of baby i
xi1 is length of gestation of baby i
xi2 = 1, if mother smokes and xi2 = -1, if not
and the independent error terms i follow a normal
distribution with mean 0 and equal variance 2.
Yi 0 1 x i1 2 x i 2 i
If mother is a nonsmoker (xi2 = -1):
E Yi 0 2 1 x i1
E Yi ( 0 2 ) 1 x i1
Interpretation of the
regression coefficients
-1
1
Weight (grams)
y 2390 143 x
3200
2700
y 2635 143 x
2200
34
35
36
37
38
39
Gestation (weeks)
40
41
42
A
B
C
65
55
45
35
25
20
30
40
50
age
60
70
Yi 0 1 x i1 2 x i 2 3 x i 3
12 x i1 x i 2 13 x i1 x i 3 i
where
Yi is treatment effectiveness for patient i
xi1 is age of patient i
xi2 = 1, if treatment A and xi2 = 0, if not
A
B
C
y = 47.5 + 0.33x
70
60
50
y = 28.9 + 0.52x
40
30
y = 6.21 + 1.03x
20
20
30
40
50
age
60
70
Analysis of Variance
Source
DF
Regression
5
Residual Error 30
Total
35
Source
age
x2
x3
agex2
agex3
DF
1
1
1
1
1
SS
4932.85
462.15
5395.00
Seq SS
3424.43
803.80
1.19
375.00
328.42
MS
986.57
15.40
F
64.04
P
0.000
H 0 : 2 3 12 13 0
F
DF
1
1
1
1
1
SS
4932.85
462.15
5395.00
Seq SS
3424.43
803.80
1.19
375.00
328.42
MS
986.57
15.40
F
64.04
P
0.000
H 0 : 12 13 0
F