model1
?model2
?
Call:
lm(formula = Weight ~ Length + Width + Length * Width, data = Perch)
Residuals:
Min 1Q Median 3Q Max
-140.11 -12.23 1.23 8.49 181.41
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 113.935 58.784 1.94 0.058 .
Length -3.483 3.152 -1.10 0.274
Width -94.631 22.295 -4.24 9.1e-05 ***
Length:Width 5.241 0.413 12.69 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 44.2 on 52 degrees of freedom
Multiple R-squared: 0.985, Adjusted R-squared: 0.984
F-statistic: 1.11e+03 on 3 and 52 DF, p-value: <2e-16
Call:
lm(formula = Weight ~ Length + Width + Length * Width + I(Length^2) +
I(Width^2), data = Perch)
Residuals:
Min 1Q Median 3Q Max
-117.17 -11.90 2.82 11.56 157.60
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 156.349 61.415 2.55 0.014 *
Length -25.001 14.273 -1.75 0.086 .
Width 20.977 82.588 0.25 0.801
I(Length^2) 1.572 0.724 2.17 0.035 *
I(Width^2) 34.406 18.745 1.84 0.072 .
Length:Width -9.776 7.145 -1.37 0.177
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 43.1 on 50 degrees of freedom
Multiple R-squared: 0.986, Adjusted R-squared: 0.985
F-statistic: 705 on 5 and 50 DF, p-value: <2e-16
log()
in R
What I want you to remember
\[\log(\mathcal{L}) = -\frac{n}{2}[\log(SSE/n) ]+\textrm{some constant}\]
log()
in R
Application Exercise
Fit a model predicting GPA
using high school gpa (HSGPA
) and verbal SAT score (SATV
). Save this as model1
Fit a model predicting GPA
using high school gpa, verbal SAT score (SATV
), and math SAT score (SATM
). Save this as model2
.
Fit a model predicting GPA
using high school gpa, verbal SAT score (SATV
), math SAT score (SATM
), and number of humanities credits taken in high school (HU
). Save this as model3
.
Choose AIC or BIC to compare models 1, 2, and 3. Rank the models.
08:00