STA 235 Lecture 9
University of Texas at Austin
2026-11-04
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.7913 0.1745 16.0 < 2e-16 ***
total_sleep_time 0.0989 0.0260 3.8 0.00016 ***
Each additional hour of sleep increases predicted GPA by about 0.10 points with a 95% CI of (0.05, 0.15).
Are we done?
total_sleep_time (TST): Average daily sleep time, recorded early in the term.cumulative_gpa: GPA at the beginning of the term.midterm: Midterm grade, recorded midway through the term.term_gpa: GPA at the end of the term.study: Four studies using different cohorts at different universities:
race: 1 if either parent from an under-represented group (non-White/Asian).first_gen: 1 if neither parent attended any college.gender: 1 if reported male, 0 otherwise.height: height in inches.Should we include or exclude this predictor?
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.7913 0.1745 16.0 < 2e-16 ***
total_sleep_time 0.0989 0.0260 3.8 0.00016 ***
Each additional hour of sleep increases predicted GPA by about 0.10 points, with a 95% CI of (0.05, 0.15)
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.5638 0.1754 3.21 0.0014 **
total_sleep_time 0.0554 0.0200 2.76 0.0059 **
cumulative_gpa 0.7275 0.0371 19.60 <2e-16 ***
2.5 % 97.5 %
(Intercept) 0.21926 0.90841
total_sleep_time 0.01602 0.09479
cumulative_gpa 0.65458 0.80036
Comparing two students with identical cumulative GPA at the start of the term, if one has an additional hour of sleep time their predicted end of term GPA will be 0.05 points higher (95% CI [0.016, 0.095])
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.6559 0.1815 3.61 0.00033 ***
total_sleep_time 0.0690 0.0205 3.37 0.00081 ***
cumulative_gpa 0.6768 0.0383 17.68 < 2e-16 ***
factor(study)3 -0.0651 0.0447 -1.46 0.14607
factor(study)4 0.1050 0.0453 2.32 0.02072 *
factor(study)5 -0.0791 0.0459 -1.72 0.08566 .
Comparing two students from the same cohort with identical cumulative GPAs, if one has an additional hour of sleep time their predicted end of term GPA will be 0.07 points higher (95% CI [0.029, 0.011] – see R script)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.6722 0.1868 3.60 0.00035 ***
total_sleep_time 0.0678 0.0205 3.31 0.00099 ***
cumulative_gpa 0.6624 0.0392 16.90 < 2e-16 ***
factor(study)3 -0.0669 0.0448 -1.49 0.13580
factor(study)4 0.0991 0.0467 2.12 0.03410 *
factor(study)5 -0.0890 0.0470 -1.90 0.05861 .
gender -0.0179 0.0322 -0.56 0.57910
race 0.0743 0.0402 1.85 0.06534 .
firstgen -0.0207 0.0439 -0.47 0.63671
Comparing two students from the same cohort with identical cumulative GPAs and the same demographics, if one has an additional hour of sleep time their predicted end of term GPA will be 0.068 points higher (95% CI [0.028, 0.011] – see R script)
2.5 % 97.5 %
(Intercept) 0.305178 1.039228
total_sleep_time 0.027587 0.108011
cumulative_gpa 0.585449 0.739448
factor(study)3 -0.154829 0.021065
factor(study)4 0.007466 0.190820
factor(study)5 -0.181315 0.003254
gender -0.081227 0.045438
race -0.004735 0.153357
firstgen -0.106904 0.065442
What if we omit gender and firstgen?
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.6435 0.1812 3.55 0.00042 ***
total_sleep_time 0.0680 0.0204 3.33 0.00094 ***
cumulative_gpa 0.6651 0.0387 17.18 < 2e-16 ***
factor(study)3 -0.0647 0.0446 -1.45 0.14747
factor(study)4 0.1071 0.0452 2.37 0.01815 *
factor(study)5 -0.0834 0.0459 -1.82 0.06969 .
race 0.0749 0.0398 1.88 0.06050 .
Nearly identical results (CIs too) – and very, very close to the model that omits demographics
Report findings from a range of models:
In other words, you should probably get more sleep!
sales_k: Quarterly sales, in thousands of dollars.trained: 1 if the rep completed the training program at the start of the quarter.experience_yrs: Years of sales experience.territory_potential: Market size of the rep’s territory (assigned by geography).client_meetings: Client meetings per week during the quarter.review_score: Performance review written after the quarter closed.office_floor: Which floor of headquarters the rep sits on.Trained reps are more experienced, but their territories look the same.
| Model | Estimate | 95% CI | Residual SE |
|---|---|---|---|
| No controls | $23.2K | [20.5, 25.9] | 19.2 |
| + experience | $12.3K | [9.7, 14.9] | 16.3 |
| + experience + territory | $11.9K | [10.0, 13.8] | 11.7 |
| + experience + territory + meetings | $4.1K | [2.3, 6.0] | 10.1 |
| + experience + territory + review | -$7.2K | [-9.4, -5.0] | 9.1 |
The true effect is $12K. Which models get it right?
experience_yrs is a confounder. Managers send veterans to training, and veterans sell more anyway.territory_potential is a strong predictor of sales that’s unrelated to training. Same estimate, narrower CI.client_meetings is a mediator. Training causes more meetings, so holding meetings fixed removes $8K of the effect.review_score is a collider. It is caused by both training and sales, so comparing reps with the same review makes training look harmful.