Stat 315: HW #11
Fall 2019
Due: Wednesday, December 4, 2019
1. An engineer is attempting to model the potential energy of a spring based on the displacement
from equilibrium of the spring. The experimental data is provided below.
x (displacement) 1 2 3 4 5
y (potential energy) 2.23 3.62 6.77 13.47 21.06
(a) Make a scatterplot of the data by hand. Comment on whether there appears to be a
linear relationship, a nonlinear relationship, or no apparent relationship.
(b) Compute the estimated regression equation by hand and sketch the line of best fit on
(c) Verify the estimated regression equation in R.
(d) Make a plot of the fitted values versus the residuals in R. Is there evidence that the
relationship is not linear? Explain.
2. The engineer suspects that there is a quadratic relationship between potential energy and
displacement. Let z = x
z (squared displacement) 1 4 9 16 25
y (potential energy) 2.23 3.62 6.77 13.47 21.06
(a) Use R to find the estimated regression equation, i.e., ˆy = b0 + b1z = b0 + b1x
(b) Using the R output, construct a 95% confidence interval for β1. Is there evidence that
β1 differs from zero? Explain.
(c) Use R to create an ANOVA table. Once you have created the ANOVA table, use it to
calculate R2 and interpret R2
in the context of the problem.
(d) What is the correlation between z and y?
(e) Complete a six-step hypothesis test to determine if there is linear relationship between
z and y at α = 0.01.
3. American astronomer, Edwin Hubble, discovered in 1929 that there was a relationship
between the relative velocity (km/sec as measured from Earth) of celestial objects (such as
stars and nebulae) and their distance (Mpc, megaparsec) from Earth. This led Hubble to
conclude that the universe must be expanding. “Hubble’s Law” states that celestial objects
tend to have a “redshift” Doppler effect and this was the result of an expanding universe.
This problem will examine Hubble’s original dataset.
Dataset > From Text (base).
Once you have loaded the dataset, run the command “head(hubble)” to see some of the data
values. What is the velocity and distance of the first data value?
(b) Using R, fit a simple linear regression model with distance (Mpc) as the predictor variable
and velocity (km/s) as the response variable. What is the estimated regression equation
and what velocity does it estimate for an object 1 Mpc from Earth?
(c) Is there evidence of a linear relationship? Conduct a six-step hypothesis test at α = 0.05.
(d) Use R to make a scatterplot with the estimated regression equation. Hint: once you
have fit your model (suppose it is called “mod”), run the command “abline(mod)” to add
the line of best fit.
(e) Construct a simultaneous 95% confidence band for mean response. Suppose it is claimed
that the mean velocity of an object 1 Mpc from Earth is 800 km/s. Using your plot, at
α = 0.05, would you reject or fail to reject this hypothesis?
(f) Construct a simultaneous 95% prediction band for a new data value. About 95% of the
the data values should fall within these bands. What percent of the data values fall inside
these bounds?
(g) Construct a plot of the fitted values versus the residuals. Is there evidence of nonconstant
variance or a nonlinearity? Explain.
(h) Construct a QQ-plot. Is there evidence that the errors are not normally distributed?
Explain.
4. For the Hubble example, ¯x = 0.91125, MSE = 54382, Sxx = 9.59, and n = 24.
(a) Compute a 95% confidence interval for mean response for Distance = 1 Mpc. Suppose
it is claimed that the mean velocity for an object at 1 Mpc is 800km/s. Would you reject or
fail to reject this claim? Explain.
(b) Compute a 95% prediction interval for a new data value for Distance = 1 Mpc. Is it
plausible that an object that is 1 Mpc from Earth has a velocity of 0 km/s relative to Earth? Explain.