Homework: Statistical Modeling and Interpretation

Author

Your Name

Published

23 November 2025

Instructions

This homework focuses on interpretation and presentation of statistical results. You will apply linear regression, ANOVA, model selection, and logistic regression to the Bechdel Test movie dataset.

Total Points: 100

Submission Requirements:

  • Self-contined HTML document with code hidden (use code-fold: true)
  • Focus on clear interpretation of results, not code mechanics
  • Please DO NOT use any LLMs in writing your answers
  • Include well-formatted tables and figures
  • Write results as if for a technical report

Background: The Bechdel Test

The Bechdel Test measures female representation in films. A movie passes if it has:

  1. At least two named women
  2. Who talk to each other
  3. About something besides a man

The test is rated 0-3, where 3 = pass, and lower scores indicate failure at different stages.


Load the Data

Show code
library(tidyverse)
library(broom)
library(knitr)

# Load the movies dataset (1970-2013)
movies <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-03-09/movies.csv')

# Preview
glimpse(movies)
Rows: 1,794
Columns: 34
$ year          <dbl> 2013, 2012, 2013, 2013, 2013, 2013, 2013, 2013, 2013, 20…
$ imdb          <chr> "tt1711425", "tt1343727", "tt2024544", "tt1272878", "tt0…
$ title         <chr> "21 &amp; Over", "Dredd 3D", "12 Years a Slave", "2 Guns…
$ test          <chr> "notalk", "ok-disagree", "notalk-disagree", "notalk", "m…
$ clean_test    <chr> "notalk", "ok", "notalk", "notalk", "men", "men", "notal…
$ binary        <chr> "FAIL", "PASS", "FAIL", "FAIL", "FAIL", "FAIL", "FAIL", …
$ budget        <dbl> 1.30e+07, 4.50e+07, 2.00e+07, 6.10e+07, 4.00e+07, 2.25e+…
$ domgross      <chr> "25682380", "13414714", "53107035", "75612460", "9502021…
$ intgross      <chr> "42195766", "40868994", "158607035", "132493015", "95020…
$ code          <chr> "2013FAIL", "2012PASS", "2013FAIL", "2013FAIL", "2013FAI…
$ budget_2013   <dbl> 13000000, 45658735, 20000000, 61000000, 40000000, 225000…
$ domgross_2013 <chr> "25682380", "13611086", "53107035", "75612460", "9502021…
$ intgross_2013 <chr> "42195766", "41467257", "158607035", "132493015", "95020…
$ period_code   <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ decade_code   <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ imdb_id       <chr> "1711425", "1343727", "2024544", "1272878", "0453562", "…
$ plot          <chr> NA, NA, "In the antebellum United States, Solomon Northu…
$ rated         <chr> NA, NA, "R", "R", "PG-13", "PG-13", "R", "R", "PG-13", "…
$ response      <lgl> NA, NA, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, …
$ language      <chr> NA, NA, "English", "English, Spanish", "English", "Engli…
$ country       <chr> NA, NA, "USA, UK", "USA", "USA", "USA", "USA", "UK", "US…
$ writer        <chr> NA, NA, "John Ridley (screenplay), Solomon Northup (base…
$ metascore     <dbl> NA, NA, 97, 55, 62, 29, 28, 55, 48, 33, 90, 58, 52, 78, …
$ imdb_rating   <dbl> NA, NA, 8.3, 6.8, 7.6, 6.6, 5.4, 7.8, 5.7, 5.0, 7.5, 7.4…
$ director      <chr> NA, NA, "Steve McQueen", "Baltasar Kormákur", "Brian Hel…
$ released      <chr> NA, NA, "08 Nov 2013", "02 Aug 2013", "12 Apr 2013", "25…
$ actors        <chr> NA, NA, "Chiwetel Ejiofor, Dwight Henry, Dickie Gravois,…
$ genre         <chr> NA, NA, "Biography, Drama, History", "Action, Comedy, Cr…
$ awards        <chr> NA, NA, "Won 3 Oscars. Another 131 wins & 137 nomination…
$ runtime       <chr> NA, NA, "134 min", "109 min", "128 min", "118 min", "98 …
$ type          <chr> NA, NA, "movie", "movie", "movie", "movie", "movie", "mo…
$ poster        <chr> NA, NA, "http://ia.media-imdb.com/images/M/MV5BMjExMTEzO…
$ imdb_votes    <dbl> NA, NA, 143446, 87301, 43608, 25735, 123837, 85871, 1897…
$ error         <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …

Key Variables:

  • binary: Pass/Fail the Bechdel test
  • budget_2013: Movie budget (adjusted to 2013 dollars)
  • domgross_2013: Domestic gross revenue (2013 dollars)
  • intgross_2013: International gross revenue (2013 dollars)
  • year: Release year
  • imdb_rating: IMDB rating (1-10 scale)
  • metascore: Metacritic score (0-100)
  • rated: MPAA rating (G, PG, PG-13, R, etc.)

Question 1: Linear Regression

Research Question: How does movie budget relate to domestic gross revenue? Does this relationship differ for movies that pass vs. fail the Bechdel test?

Part A: Model Fitting

Fit a linear regression model predicting domestic gross revenue from budget, Bechdel test result (binary), and their interaction.

Show code
# Your code here
# Hint: You may need to clean data (remove NAs, log-transform if appropriate)

Part B: Interpretation

In 3-4 sentences, interpret: 1. The coefficient for budget 2. The coefficient for the interaction term 3. The practical significance of your findings

Your interpretation here:

Part C: Diagnostic Plots

Create 2 diagnostic plots and briefly comment on whether model assumptions are reasonably met.

Show code
# Your diagnostic plots here

Comment on assumptions (2-3 sentences):


Question 2: Logistic Regression

Research Question: What movie characteristics predict passing the Bechdel test?

Part A: Model Fitting

Fit a logistic regression model predicting Bechdel test pass/fail from budget, year, and IMDB rating.

Show code
# Your code here
# Note: Create a binary outcome (0/1) from the 'binary' variable

Part B: Coefficient Interpretation

Present a table of odds ratios with 95% confidence intervals. Interpret the odds ratio for year in context.

Show code
# Your table here (consider using tidy() and exp() for odds ratios)

Interpretation (4-5 sentences):

Part C: Prediction and Visualization

Create a visualization showing the predicted probability of passing the Bechdel test over time (holding other variables at their means). Include confidence bands if possible.

Show code
# Your visualization here

Describe the trend (2-3 sentences):


Question 3: Comprehensive Analysis

Research Question: Does the relationship between budget and revenue differ across MPAA ratings (G, PG, PG-13, R)?

Conduct an appropriate analysis (your choice of method) and present your findings professionally.

Your Analysis

Show code
# Your code here

Findings

Write a brief results section (150-200 words) as if for a technical report. Include: - Description of your analytical approach - Key statistical findings - At least one figure or table - Interpretation in context of the research question


Submission Checklist


References

TidyTuesday: Bechdel Test (2021-03-09). Data from FiveThirtyEight and The Bechdel Test website.
https://github.com/rfordatascience/tidytuesday/blob/master/data/2021/2021-03-09/readme.md