M. Drew LaMar
February 14, 2020
These were our steps for fitting a linear model:
Using backward elimination with the adjusted \( R^2 \) method:
winner <- lm(price ~ cond + stock_photo + wheels, data = mario_kart)
summary(winner)
Call:
lm(formula = price ~ cond + stock_photo + wheels, data = mario_kart)
Residuals:
Min 1Q Median 3Q Max
-11.454 -2.959 -0.949 2.712 14.061
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 36.0483 0.9745 36.990 < 2e-16 ***
condnew 5.1763 0.9961 5.196 7.21e-07 ***
stock_photoyes 1.1177 1.0192 1.097 0.275
wheels 7.2984 0.5448 13.397 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.884 on 137 degrees of freedom
Multiple R-squared: 0.719, Adjusted R-squared: 0.7128
F-statistic: 116.8 on 3 and 137 DF, p-value: < 2.2e-16
Do a qqplot of the residuals:
qqnorm(residuals(winner))
Residuals vs. fitted values:
plot(fitted(winner), residuals(winner))
Residuals vs order of collection (ID):
plot(mario_kart$ID, residuals(mario_kart))
par(mfrow=c(1,3))
boxplot(residuals(winner) ~ cond, data = mario_kart)
boxplot(residuals(winner) ~ stock_photo, data = mario_kart)
plot(residuals(winner) ~ wheels, data = mario_kart)
Discuss: What is a model?
Question: Is this a model?
Question: Is this a model?
Question: Is this a model?
Question: Is this a model?
Question: Is this a model?
Discuss: What are the components of a model?
Answer:
Definition: A
model is a simplified, abstract (or concrete) representation of objects and their relationships and/or processes in the real world.
Question: What are the model components for this model?
Definition: A
model is a simplified, abstract (or concrete) representation of objects and their representations or processes in the real world.
Quote: “Meaningful data of sufficient quantity are the grist of scientific bread.”
Quote: “If data are collected in an appropriate manner, then there is information in the sample data about the process or system under study.”
Quantification is essential due to variation and complexity.
Quote: “Unless one is engaged in simple descriptive studies, they [the empirical sciences] must deal with mathematical models.”
Quote: “We are not trying to model the data; instead, we are trying to model the information in the data.”
Quote: “Data contain both information and noise; fitting the data perfectly would include modeling the noise and this is counter to our science objective.”