SLR_Example_June302011.pdf

ST512
NCSU-Statistics
SSII 2011
Simple Linear Regression - Example
The failure rate (or hazard rate) h  t  of a system is related to the conditional probability that the
system will fail in the next instant of time given that it has survived to time t . The hazard rate of a
particular brand of personal computer is thought to be a power function of its age t , so that h  t   ct d ,
where c and d are parameters with unknown values that need to be estimated. To convert the above
expression to a linear equation involving c and d we take the log (base 10) of each side to obtain
log10 h  t   log10 c  d log10 t , or y  o  1 x , where y  log10 h  t  , o  log10 c , 1  d , and
x  log10 t .
A large number of computers were put on test for 10 hours to obtain an estimate of the hazard rate for
each of the ten hours. The results are shown below
data
The following straight line model was proposed
xt  log10 ti
yt  log10 hi
1
0
0.02119
2
0.301
0.596
3
0.4771
0.91381
4
0.6021
1.24551
5
0.699
1.39794
6
0.7782
1.57978
7
0.8451
1.6902
8
0.9031
1.77085
9
0.9542
1.92942
10
1
1.989
t(hours)
y  o  1 x  
In matrix form,
Model is Y  X  e















1
1
1
1
1
1
1
1
1
1
, where

e ~ MVN 0,  2I


0.02119   e1 

 0.596   e 
0.301 

  2
 0.91381  e3 
0.4771


  
0.6021
1.24551   e4 
0.699    0  1.39794   e5 


 
0.7782   1  1.57978   e6 
 1.6902   e 
0.8451 β


  7
0.9031
1.77085

  e8 
1.92942   e 
0.9542 


  9
 1.989  e10 
1 
e
Y
X
0
Estimate β by b , such that  Y  Xb   Y  Xb  is minimized: Least squares estimation
Normal Equations  XX  b  XY , solving for b to get the minimum residual sum of squares
b   XX  XY
1
Estimate regression coefficients
6.5598 
 10
XX  

6.5598 5.2152273
Example taken from Dr. Tom Reiland ST 511 (NCSU Sum 1, 2010).
Page 1
ST512
 XX 
NCSU-Statistics
1

b   XX 
SSII 2011
5.2152273 6.5598  0.5717638 0.719174 
1

2 
10   0.719174 1.096335 
52.152273  6.5598  6.5598
1
 0.5717638 0.719174  13.1337   0.008723097



 0.719174 1.096335  10.429536  1.988850 
 XY   
Linear Regression Equation
yi  0.008723097  1.98850xi
Calculate residuals
residual = Y  Y  Y  Xb
x2  0.301
For y2  0.008723097  1.98850  0.301  0.60737
e2  0.596  0.60737  0.01137
0.02119   0.00872   0.01247 
 0.596   0.60737   0.01137 

 
 

 0.91381  0.95760   0.04379 

 
 

1.24551  1.20621   0.03930 
1.39794  1.39893   0.00099 




1.57978  1.55645   0.02333
 1.6902  1.68950   0.00070 

 
 

1.77085  1.80486   0.03400 
1.92942  1.90649   0.02293

 
 

 1.989  1.99758   0.00858
Y
Y
e
Calculate residual degrees of freedom
dfe = Error df = n – 2 ( one intercept + one slope)
Calculate the residual sum of squares  Y  Xb   Y  Xb   SSE
Residual variance estimated by MSE = SSE/df = (0.01246782 + . . . + (-0.008575)2)/8 = 0.0007561
Variance of b = Vb  var  b    XX   2
1
Where  2 is the variance of ei estimated by MSE = 0.0007561.
,
Estimate covariance matrix for regression coefficients
 0.5717638 0.719174
 0.0004323 0.000544
Vb  var  b   
 0.0007561  


 0.719174 1.096335 
 0.000544 0.0008289 
var(bo) = 0.0004323
var(b1) = 0.0008289
cov(bo, b1) = -0.000544
Example taken from Dr. Tom Reiland ST 511 (NCSU Sum 1, 2010).
Page 2
ST512
NCSU-Statistics
SSII 2011
Test of Hypothesis
H o : 0  0
H1 :  0  0
  P  Type I Error  0.05
tc 
b0
0.008723

 0.42,
sb0
0.0004323
P  t8 df  0.42   0.6859
Do not reject Ho , there is not enough statistical evidence to reject
H o : 1  0
H1 : 1  0
  P  Type I Error  0.05
tc 
b1
1.98885

 69.08,
sb1
0.0008289
P  t8 df  69.08   .0001
Reject Ho , there is enough statistical evidence to reject
95% Confidence Interval for

, thus we conclude
.

Conf bi  t 0.975,df 8  sbi  100
95% Confidence Interval for
Conf  0.008723  2.306  0.02079   100%
Conf  0.03922  0  0.05667   100%
95% Confidence Interval for
Conf 1.98885  2.306  0.02879   100%
Conf 1.94630  1  2.03140   100%
Example taken from Dr. Tom Reiland ST 511 (NCSU Sum 1, 2010).
Page 3