library(car)
pres<-Prestige
head(pres)
## education income women prestige census type
## gov.administrators 13.11 12351 11.16 68.8 1113 prof
## general.managers 12.26 25879 4.02 69.1 1130 prof
## accountants 12.77 9271 15.70 63.4 1171 prof
## purchasing.officers 11.42 8865 9.11 56.8 1175 prof
## chemists 14.62 8403 11.68 73.5 2111 prof
## physicists 15.64 11030 5.13 77.6 2113 prof
Yes. The census, education, income and type were good explanaitors of the prestige.
Only a subset mentioned above.
It does well. \(R^2 = 0.8407\)
pres.lm6<-lm(pres$prestige~pres$education+pres$income+pres$census+pres$type)
summary(pres.lm6)
##
## Call:
## lm(formula = pres$prestige ~ pres$education + pres$income + pres$census +
## pres$type)
##
## Residuals:
## Min 1Q Median 3Q Max
## -13.0873 -4.9935 0.7435 4.9617 19.4891
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.144e+01 7.823e+00 -1.462 0.1472
## pres$education 3.947e+00 6.498e-01 6.075 2.76e-08 ***
## pres$income 9.365e-04 2.221e-04 4.217 5.79e-05 ***
## pres$census 1.125e-03 6.113e-04 1.840 0.0691 .
## pres$typeprof 1.091e+01 4.645e+00 2.348 0.0210 *
## pres$typewc 5.605e-01 3.062e+00 0.183 0.8551
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 7.006 on 92 degrees of freedom
## (4 observations deleted due to missingness)
## Multiple R-squared: 0.8407, Adjusted R-squared: 0.8321
## F-statistic: 97.12 on 5 and 92 DF, p-value: < 2.2e-16
And the Akaike Information Critireon (AIC) of this model is the lowest. ###4. Given a set of predictor values, what response value should we predict, and how accurate is our prediction?###
\(prestige = -1.144e+01 + 3.947e+00\text{ education} + 9.365e-04\text{ income} + 1.125e-03\text{ census} + 1.091e+01\text{ typeprof} + 5.605e-01\text{ typewc}\)
plot(fitted(pres.lm6), residuals(pres.lm6))
abline(a=0, b=0)
The standard error will be 7.006.
R