Skip to course content
Free Python statistics course

Statistical Data Analytics with Python

Module 08 Activity

Scenario

Fit and interpret a simple relationship without overclaiming what it shows.

What you build

A statsmodels regression with its assumptions checked, its interval reported and its purpose stated.

Steps

  1. Plot the relationship before quoting any correlation, and check whether one point is driving it.
  2. Choose Pearson or Spearman deliberately, and treat a large gap between them as evidence of curvature.
  3. Fit with smf.ols, report the slope with its confidence interval, and state the observed range of the predictor.
  4. Inspect the residuals for pattern and report the residual standard deviation as well as R-squared.
  5. Decide whether the question needs mean_ci or obs_ci from get_prediction(...).summary_frame(), and say which your figure shows.
  6. State whether you are predicting or explaining, and list the confounders you could not measure.

Evidence to hand in

Review checklist