Recall & Review
beginner
What is the purpose of the
lm() function in R?The
lm() function fits a linear regression model, which finds the best straight line to describe the relationship between a dependent variable and one or more independent variables.Click to reveal answer
beginner
In the formula
lm(y ~ x, data = df), what does y ~ x mean?It means we want to predict
y (dependent variable) using x (independent variable). The tilde ~ separates the outcome from the predictor.Click to reveal answer
beginner
What does the coefficient estimate in a linear regression model represent?
It shows how much the dependent variable changes when the independent variable increases by one unit, assuming other variables stay the same.
Click to reveal answer
beginner
How do you check the summary of a linear model in R?
Use the
summary() function on the model object, like summary(model). It shows coefficients, significance, and model fit statistics.Click to reveal answer
intermediate
What does the
Residuals section in summary(lm) tell you?It shows the differences between observed and predicted values. Small residuals mean the model fits the data well.
Click to reveal answer
What does the
lm() function in R do?✗ Incorrect
The
lm() function fits a linear regression model to data.In
lm(y ~ x, data = df), what is y?✗ Incorrect
y is the dependent variable we want to predict.Which function shows detailed results of a linear model in R?
✗ Incorrect
summary() shows coefficients, residuals, and statistics of the model.What does a coefficient estimate of 2 mean in a simple linear regression?
✗ Incorrect
Coefficient 2 means y changes by 2 units for every 1 unit increase in x.
What do residuals represent in a linear regression model?
✗ Incorrect
Residuals are the errors or differences between actual and predicted values.
Explain how to fit a simple linear regression model in R using
lm() and interpret the output.Think about predicting one variable from another and checking the model summary.
You got /5 concepts.
Describe what residuals are in linear regression and why they matter.
Residuals tell us how well the model predictions match the actual data.
You got /4 concepts.