Title: Statistics 483
1Chapter 5
- Multivariate Regression
- Inferences and model comparison
2Example Fuel Consumption
3Comparing Two Regression Models
- Full Model
- Reduced Model
- Is the full model significantly better than the
reduced model in explaining the variation in y? - E.g.
4F-test for comparing Two Regression Models
To test H0 ?L1 ?L2 ?k 0 versus Ha
At least one of the ?L1 , ?L2, , ?k is not
equal to 0
Test Statistic
5F-test for comparing Two Regression Models
- P-value P(F(df1,df2) gt Fratio)
- Reject H0 in favor of Ha if p-value lt a
- Fdf1,df2 is based on (k-L) numerator and
- n-(k1) denominator degrees of freedom
6Example Fuel Consumption
Full Model
Reduced Model
7Example Fuel Consumption
8Prediction
Prediction Equation
is the point prediction of an individual value of
the dependent variable when the values of the
independent variables are x01, x02, , x0k.
b1, b2, , bk are the least squares point
estimates of the parameters ?1, ? 2, , ?
k. x01, x02, , x0k are specified values of the
independent predictor variables x1, x2, , xk.
9Example Fuel Consumption
Data see Fuel2
10Using The Regression Equation to Make Predictions
- Predict the amount of Fuel consumption used for a
home (i) if the average temperature is Xi1 400
and the Chill index is Xi2 10. - E(Y) 13.157 - 0.090 (Xi1) 0.076 (Xi2)
- 13.157 - 0.090 (40) 0.076 (10)
- 10.317
11Confidence Intervals for mean of y
Prediction
If the regression assumptions hold,
100(1 - a) prediction interval for the mean
value of y
Calculation of the standard error (s.e.) requires
matrix algebra
ta/2 is based on n-(k1) degrees of freedom
12(No Transcript)
13Prediction of Mean Values in JMP
- Type in x values in the dataset ? Leave y value
empty ? select Analyze ? select Fit Model ? fuel
into Y ? put temp and chill into Add ? select Run
Model ? click red triangle or click right mouse
button ? select Save Columns ? select Predicted
Values OR select Mean Confidence Interval
14(No Transcript)
15Fitting Curves to Data
16Idea of Fitting Curves
- Instead of fitting y and x, fit y and g(x)
- Here, g(x) means a transformation of x
- E.g, if x and y are related in a curvilinear
fashion, then perhaps x2 and y have a linear
relationship
17Example Telemarketing
- A telemarketing division sells the companys
service - - 20 employees
- Data on the number of months of employment (x)
- and the number of calls placed per day (y)
Data Telemarketing
18Example continued
As the number of months on the job increases,
the number of calls also increases. But the rate
of increase begins to slow over time
19Example Telemarketing
The fitted model calls -0.14 2.31 months -
0.04 months2
20(No Transcript)
21(No Transcript)
22(No Transcript)
23(No Transcript)
24(No Transcript)
25Example Telemarketing
26Example MPG Versus HP
27MPG versus HP
- What kind of relationship do we have?
- MPG?0?1(1/HP)e
28The Quadratic Regression Model
- Relationship Between the Response Variable and
the Explanatory Variable is a Quadratic
Polynomial Function - Useful When Scatter Diagram Indicates Non-linear
Relationship - Quadratic Model
- The Second Explanatory Variable is the Square
of the First Variable
29Quadratic Regression Model
Quadratic model may be considered when a scatter
diagram takes on the following shapes
Y
Y
Y
Y
X1
X1
X1
X1
?2 gt 0
?2 gt 0
?2 lt 0
?2 lt 0
?2 the coefficient of the quadratic term
30Testing for Significance Quadratic Model
- Testing for Overall Relationship
- Similar to test for linear model
- F test statistic
31Testing for Significance Quadratic Model
- Testing the Quadratic Effect
- Compare quadratic model
- with the linear model
- Hypotheses
- (No quadratic term)
- (Quadratic term is
needed)
32Heating Oil Example
Determine if a quadratic model is needed for
estimating heating oil used for a single family
home in the month of January based on average
temperature and amount of insulation in inches.
Data Heating
33Heating Oil Example
34Heating Oil Example t Test for Quadratic Model
- Testing the Quadratic Effect
- Model with quadratic insulation term
- Model without quadratic insulation term
- Hypotheses
- (No quadratic term in
insulation) - (Quadratic term is needed
in insulation)
35Quadratic Regression in JMP
- Analyze ? Fit Model ? put Oil in Y ? put Temp
Insul in Add ? click on Insul in both left
and right boards ? click on Cross ? Run Model
36Example Solution
37Example Solution
Is quadratic term in insulation needed on monthly
consumption of heating oil? Test at ? 0.05.
H0 ?3 0 H1 ?3 ? 0 df 11
Test Statistic
P-value0.1249 Decision Do not reject H0 at ?
0.05
Conclusion There is not sufficient evidence for
the need to include quadratic effect of
insulation on oil consumption.
38A second-order Regression Model
Model
39Telemarketing Data 1st order Non Constant
Variance
40Tests for Lack of Fit
41F test for testing nonlinearity
F test Pure error Lack of-fit Lack of
fit / Pure error
42Telemarketing example, 1st order
43- F ratio Lack of fit / Pure error
- 4.038 / 0.50
- 8.077
- Df112, df26
- P-value
- P(F(12,6) gt 8.077) 0.008
-
-
44Corrections for non-constant Variance
- Polynomial regression
- Transformation of X
- Transformation on X and Y
- E.g., the natural logarithm of y, ln(y)
- ln(y) is appropriate when the residual plot shows
increasing error variance - Square root transformation is another possibility
451. Polynomial regression
- Check beta related to the quadratic term
- Check if the residual plot with the new linear
model has been improved
46Telemarketing example 2nd order
47(No Transcript)