A fitted model becomes useful when its coefficients are applied to a new case.

Program

Play the script to change the planned study hours and see the predicted score.

prediction_scenario.R
new_hours <- 
intercept <- 43
slope <- 9
predicted <- intercept + slope * new_hours
label <- paste("pred", predicted, sep = ":")
cat(label, "\n", sep = "")
new_hours <- 
intercept <- 43
slope <- 9
predicted <- intercept + slope * new_hours
label <- paste("pred", predicted, sep = ":")
cat(label, "\n", sep = "")
new_hours <- 
intercept <- 43
slope <- 9
predicted <- intercept + slope * new_hours
label <- paste("pred", predicted, sep = ":")
cat(label, "\n", sep = "")
prediction A prediction plugs a new predictor value into the fitted equation.
intercept `intercept` is the baseline value when the predictor is zero.
slope `slope * new_hours` adds the predictor contribution.