Question: Use this syntax to read in the data for this problem. ( If you get an error about the package not being loaded, then uncomment
Use this syntax to read in the data for this problem. If you get an error about the package not being
loaded, then uncomment the first line and rerun the code.
Give the sample size:
Let's generate a plot of the data and overlay the bestfit line:
gfpoint Weight WingLength, dataSparrows gflm
Next, we'll generate the linear regression model:
out Weight WingLength, dataSparrows
out
Give the regression model parameter estimates for the line:
intercept:
slope:
Now we will calculate the confidence interval for the slope. This gives us the range in which we would
expect to find the true slope For a confidence interval, we will need information from these two
commands:
summary out
Give the lower and upper bounds for the confidence interval for the slope for this model:
To obtain predictions the fitted values at our data points, we can use the command:
fitted out
These predictions are also called conditional means the "average" values for the dependent variable
conditional on a given value for the independent variable If we want a predicted value conditional
mean at some specific input WingLength, say wingLength we can make a function specifically designed
for such predictions.
weightPredictor makeFun out
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
