library(mosaic)
library(dplyr)
library(googledrive)
library(googlesheets4)Load libraries
Let’s have a quick look at the data:
! Using an auto-discovered, cached token.
To suppress this message, modify your code or options to clearly consent to
the use of a cached token.
See gargle's "Non-interactive auth" vignette for more details:
<https://gargle.r-lib.org/articles/non-interactive-auth.html>
ℹ The googlesheets4 package is using a cached token for 'jfieberg@umn.edu'.
✔ Reading from "2026Scrabble (Responses)".
✔ Range 'Form Responses 1'.
head(scrabble)# A tibble: 0 × 2
# ℹ 2 variables: Letters <lgl>, Score <lgl>
Let’s visualize the data with a scatterplot, overlaying the regression line:
gf_point(Score~Letters, data=scrabble) %>% gf_lm()And, now fit the linear regression model:
lm.scrab<-lm(Score~Letters, data=scrabble)
summary(lm.scrab)Exercises
- Review interpretation of intercept and slope
- Calculate Y^ for your name
- Calculate a CI for the slope using the summary output
- Know how to calculate the info in the 3rd and 4th columns of the summary output
- Know how to interpret R^2 and residual standard error (i.e., sigma^) Predictions and confidence intervals
scrab.pred<-makeFun(lm.scrab)
scrab.pred(Letters=10, interval="confidence")
scrab.pred(Letters=10, interval="prediction")How do we interpret these intervals?
- confidence interval: I am 95% sure that the mean scrabble score among individuals that have 10 letters in their name is between 17.47 and 20.16.
- prediction interval: I am 95% sure that the scrabble score for an individual with 10 letters in their name is between 17.47 and 20.16.