Lecture 2
Lecture 2
Lu 1
1 Preview
Fall 2022
Applied Statistical Methods, T. S. Lu 2
3 General Strategy
• forward method
• backward method
µY |X = β0 + β1X
where β0 and β1 are the intercept and the slope of this (population)
straight line, respectively. Equivalently,
Y = β0 + β1X + E
Fall 2022
Applied Statistical Methods, T. S. Lu 4
E = Y − (β0 + β1X)
or by
E = Y − µY |X
σY2 |X ≡ σ 2
Remarks:
Fall 2022
Applied Statistical Methods, T. S. Lu 5
b = Y − Yb = Y − (βb0 + βb1X)
E
Fall 2022
Applied Statistical Methods, T. S. Lu 6
βb0 = Y − βb1X
5.3 Example
/*Descriptive statistics*/
proc means data=stat.sbp;
var sbp age;
run;
Fall 2022
Applied Statistical Methods, T. S. Lu 7
/*Independent T-test*/
proc ttest data=stat.sbp;
class group;
var sbp;
run;
/*Scatterplot*/
goptions reset=all htext=2;
symbol1 color=black value=dot w=3 ;
axis1 order=(10 to 70 by 10) minor=none;
axis2 order=(100 to 240 by 20) minor=none ;
proc gplot data=stat.sbp;
plot sbp*age / haxis=axis1 vaxis=axis2;
run;
quit;
Fall 2022
Applied Statistical Methods, T. S. Lu 8
Descriptive Statistics
Uncorrected Standard
Variable Sum Mean SS Variance Deviation
Fall 2022
Applied Statistical Methods, T. S. Lu 9
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
n
X
SSE = (Yi − Ybi)2
i=1
If SSE = 0, the straight line fits perfectly. On the other hand, if the
fit gets worse, SSE gets larger. There are two possible factors for the
inflation of SSE. First, there might be a lot of variation in the data;
that is, σ 2 might be large. Second, the assumption of a straight-line
model may not be appropriate for the data. Here, we will assume
Fall 2022
Applied Statistical Methods, T. S. Lu 10
n
X
(Xi − X)(Yi − Y )
i=1
βb1 = n
X
b i )2
(Xi − X
i=1
βb0 = Y − βb1X
Fall 2022
Applied Statistical Methods, T. S. Lu 11
n
1 X
SY2 |X = (Yi − Ybi)2
n − 2 i=1
n
2 1 X
SY = (Yi − Y )2
n − 1 i=1
n
2 1 X
SX = (Xi − X)2
n − 1 i=1
SY |X
Sβb1 = √
SX n − 1
s
2
1 X
Sβb0 = SY |X + 2
n (n − 1)SX
s
1 (X0 − X)2
SYbX = SY |X + 2
0 n (n − 1)SX
β1 : βb1 ± tn−2,1−α/2Sβb1
Fall 2022
Applied Statistical Methods, T. S. Lu 12
β0 : βb0 ± tn−2,1−α/2Sβb0
β1 : βb1 ± tn−2,1−α/2Sβb1
• Tests of hypotheses:
(0)
(0) (βb1 − β1 )
– H0 : β1 = β1 ; Test Statistics (T) =
Sβb1
(0)
(0) (βb0 − β0 )
– H0 : β0 = β0 ; Test Statistics (T) =
Sβb0
(0)
(0)
Y + βb1(X0 − X) − µY |X0
– H0 : µY |X0 = µY |X0 ; Test Statistics (T) =
SYbX
0
Fall 2022
Applied Statistical Methods, T. S. Lu 13
(0)
YbX0 − µY |X0
T =
SYbX
0
Fall 2022
Applied Statistical Methods, T. S. Lu 14
YbX0 ± tn−2,1−α/2SYbX
0
Output Statistics
Fall 2022
Applied Statistical Methods, T. S. Lu 15
Fall 2022
Applied Statistical Methods, T. S. Lu 16
Fall 2022
Applied Statistical Methods, T. S. Lu 17
Fall 2022