Fitting and breaking models

Research Methods — Week 8 Application

Today’s plan

Two parts

Part Time What
Regression 45 min Apply lm() to your project (if relevant)
Extrapolation 25 min A structured exercise everyone does

Questions?

Submit questions anonymously:

PollEv.com/geol

text geol to 07480 781235

Brief guided example

🎓💻 Quick demo

Regression workflow

🖥️ Switching to WebR

  1. Fit lm(y ~ x, data = df)
  2. summary() — coefficients, R²
  3. plot(model) — diagnostics
  4. Interpret: slope, R², residual patterns

Group work

✏️💻 Regression on your data

Your analysis

Groups with a regression question: fit and diagnose.

Groups with t-test/ANOVA: refine existing analyses — add effect sizes, improve figures, document assumptions.

All groups: write a Methods and Results section draft.

Extrapolation exercise

✏️💻 Breaking a model

UK renewable energy: 2010–2024

Everyone does this exercise, regardless of project topic.

The WebR page has scaffolded exercises:

  1. Fit a linear model to the renewable trend. Plot it.
  2. Extrapolate to 2040. What does it predict?
  3. Fit an exponential model. Extrapolate to 2040.
  4. Which is better? Is either plausible?
  5. What is the model not capturing?

Discussion

💬 What did you find?

The extrapolation lesson

  • Both models fit the data well in-sample
  • Both produce absurd predictions out-of-sample
  • In-sample quality tells you nothing about out-of-sample quality

“What is the model not capturing?”

The question that separates a good analyst from HolmesCo.

Your project

“In our project, the biggest thing our analysis might be missing is…”

Wrap-up

Commit your work

Commit all analysis code and results.

Your analysis is now nearly complete.

Next two weeks: refine, write up, and have it reviewed.