What’s the score?

Lab 4B

Directions: Follow along with the slides, completing the questions in blue on your computer, and answering the questions in red in your journal.

Space, Click, Right Arrow or swipe left to move to the next slide.

Previously

Predictions using a line

predict_height <- function(armspan) {
  ____ * armspan + ____
}

Make your predictions

____ <- mutate(____, predicted_height = ____(____))

Sums of differences

____ <- mutate(____, residual = ____ - ____)
summarize(____, sum(____))

Mean squared error

summarize(____, mean((____)^2))

Regression lines

best_fit <- lm(____ ~ ____, data = arm_span)

Plotting regression lines

add_line(intercept = ____, slope = ____)

Predicting with regression lines

____ <- mutate(____, predicted_height = predict(____))

The magic of lm()