young310jodi I ran into this issue today as well with a student, in the exact same spot (code block for 3.2). What this means is that one of the models was constructed incorrectly, hence it not being able to find default_rate
. For my situation, they had swapped the response and explanatory variable in sat_model_1
. Instead of the correct
sat_model_1 <- lm(default_rate ~ SAT_avg, data = sample_dat)
they had written
sat_model_1 <- lm(SAT_avg ~ default_rate, data = sample_dat)
It's a mistake I've seen several times in the previous notebooks too, but it really bites them in NB4.
Let me know if that's the issue!
Edit to add: you can also figure out which line is causing the error by commenting out every line of code (adding a # to the start of the line) and then uncommenting the lines one by one.