Stat 301 Lab 7 – In Lab

advertisement
Stat 301 Lab 7 – In Lab
Overview
In this lab you use Fit Model in JMP to look at interaction and polynomial models. You
will also look at how to tell JMP to fit the model you specify.
Warm-up Exercise
Fit Model allows you to construct multiple regression models. Some of these models
can contain interaction or polynomial terms. The Fit Model platform automatically
centers explanatory variables (subtracts off the sample mean) before creating an
interaction or polynomial term. In order to create a model with interaction and
polynomial terms like we have seen in the class examples you must tell JMP to turn off
the Center Polynomial option. To do this select Analyze – Fit Model. The red triangle
next to Model Specification contains the option to Center Polynomials. This option is
checked (active) by default. To turn this option off, click on the option and the check
mark should disappear.
In class we looked at the relationship between the auction prices of antique clocks (Y)
and the age of the clock. There was a second explanatory variable, the number of bidders
at the auction. The data appear on the course web site
www.public.iastate.edu/~wrstephe/stat301.html
Open up the data set on the auction price, age and number of bidders.
1. To fit a simple linear model of price on age, cast Price into the role of the Y
(response) variable and add the variable Age to the Construct Model Effects box. Be
sure to make the emphasis – Minimal Report.
2. To fit the no interaction model of price on age and bidders, add both Bidders and Age
to the Construct Model Effects box.
3. To fit the interaction model, go to the Model Specification red triangle pull down and
turn off (un-check) the Center Polynomials option. Add Bidders and Age to the
Construct Model Effects box. Highlight both Age and Bidders in the Select Columns
(to do this hold down the CTRL key while clicking on the variables) box and click on
Cross. This will add the Age*Bidders interaction term to the model with Age and
Bidders.
4. Go to Fit Model and use the Recall button to go back to the interaction model. Click
on Age in the Construct Model Effects box and try to Remove Age from the model
with Age, Bidders, and Age*Bidders. What happens?
1
In class we introduced the example involving the U. S. Population. The response
variable, Y, is Population. The explanatory variable is the Year the census was taken. The
data is available on the course web page
www.public.iastate.edu/~wrstephe/stat301.html
Go to the course web page and open the data for the U. S. Population example with JMP.
1. To fit a polynomial model using Fit Model, turn off the Center Polynomials option
on the Model Specification pull down menu. Enter Population as the Y (response)
variable. Add Year to the Construct Model Effects box. Highlight Year twice, once
by clicking on Year in Select Columns and also by clicking on Year in Construct
Model Effects and click on Cross. This will add the variable Year*Year to the
model. The output will include a plot of the data and the quadratic prediction
equation. Right click on the Year axis and select Axis Settings. Make the Minimum
1770, the Maximum 2030, the Increment 50 and the # Minor Ticks 4.
2. In Fit Model you can also specify a polynomial model by using Macros. Once you
have put Population as Y, highlight Year by clicking on Year under Select Columns.
Go to Macros and select Polynomial to Degree (the JMP default is degree 2, a
quadratic model).
3. You can also fit polynomial models with the Fit Y by X platform. In Fit Y by X put
Population in for Y, Response and Year in for X, Factor. The output will have a plot
of the data. You may want to change the Axis Settings for the Year axis. Go to the
pull down menu (red triangle) next to Bivariate Fit of Population By Year and
select Fit Special. Select Degree: 2 Quadratic and click on the check mark next to
Centered Polynomial to turn off the center polynomial option. Click on OK.
4. The output of Fit Y by X is the same as that of Fit Model except that Fit Y by X does
not have the Effect Tests nor are you able to save confidence intervals for the mean
response or prediction intervals for an individual response.
Caution: The Fit Polynomial in Fit Y by X will automatically center Year (subtract off
the explanatory variable mean) before creating the polynomial term. This will create a
prediction equation of the form:
Predicted Population = –2510.7 + 1.36*Year + 0.006776*(Year – 1990)2
2
Download