MATH 314 Quiz 20

Given on 2025-11-12

Please submit a Jupyter notebook to the Quiz 20 repository by the end of class today.

  1. Use Polars to read in the possum dataset and select the columns pop, skullW, and totalL. Remove any missing data (nulls). Here's the README for these data. Pay attention to units.

  2. Fit a linear model to predict totalL using the categorical variable pop.

  3. Calculate the group mean for the level other of pop.

  4. Calculate the group mean for the level vic of pop.

  5. Use the method conf_int on the object returned from the method fit to calculate confidence intervals for the two coefficients from this linear model.

  6. Interpret each confidence interval in context of the data.

  7. What does the confidence interval on vic tell you about the mean total length of possum from vic as opposed to other?

  8. Make a scatter plot of totalL (y-axis) on skullW (x-axis). Label the axes and include units.

  9. Fit a linear model to predict totalL using the numeric variable skullW.

  10. Interpret in context of these data intercept.

  11. The intercept in context of these data does not make sense. Why not?

  12. Interpret in context of these data the slope.

  13. Repeat the scatter plot above, but now add the fitted line to your plot.

  14. Use the method conf_int on the object returned from the method fit to calculate confidence intervals for the two coefficients from this linear model.

  15. Use the function [scipy function scipy.stats.pearsonr(x, y)] to calculate the correlation between totalL and skullW. Then calculate . Confirm the value of with the output from 9.

  16. What does the confidence interval on the slope tell you about these data?

  17. Fit a linear model to predict totalL using the numeric variable skullW in a quadratic form. That is use skullW and skullW ** 2 to predict totalL.

  18. Which model, the linear one or the quadratic one, predicts more of the variation in totalL?

  19. Which model, the linear one or the quadratic one, is a more realistic model for these data? Why?

  20. Repeat the scatter plot above, but now add the fitted line and the fitted curve. Label each fit appropriately and add a legend.