knitr::opts_chunk$set(echo = TRUE)
Add text here
Total expenditures: Add more text here
mod_totexp <- lm(totexp/1e6 ~ msda + phdfld + ggacpe + initcirc + type,
data = arl_totexp)
summary(mod_totexp)
##
## Call:
## lm(formula = totexp/1e+06 ~ msda + phdfld + ggacpe + initcirc +
## type, data = arl_totexp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -44.633 -4.644 -0.066 3.929 43.233
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.150e+00 3.489e+00 2.050 0.04325 *
## msda 2.048e-03 9.928e-04 2.063 0.04197 *
## phdfld 1.726e-01 4.244e-02 4.067 0.00010 ***
## ggacpe 1.112e-04 6.579e-05 1.690 0.09433 .
## initcirc 7.316e-05 9.479e-06 7.718 1.38e-11 ***
## typeS -8.359e+00 2.632e+00 -3.176 0.00203 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 10.6 on 92 degrees of freedom
## Multiple R-squared: 0.6722, Adjusted R-squared: 0.6544
## F-statistic: 37.74 on 5 and 92 DF, p-value: < 2.2e-16
pred_totexp <- predict(mod_totexp, newdata = uva_totexp)
compare(pred_totexp, uva_totexp$totexp/1e6)
## Predicted: $27.78
## Actual: $40.03
# also try msda in place of gradstu
Materials Expenditures: add more text here
mod_explm <- lm(explm/1e6 ~ msda + phdfld + ggacpe + initcirc + type,
data = arl_explm)
summary(mod_explm)
##
## Call:
## lm(formula = explm/1e+06 ~ msda + phdfld + ggacpe + initcirc +
## type, data = arl_explm)
##
## Residuals:
## Min 1Q Median 3Q Max
## -15.6722 -1.8072 -0.4022 1.4197 22.0490
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.722e+00 1.604e+00 3.567 0.000576 ***
## msda 7.519e-04 4.566e-04 1.647 0.103004
## phdfld 8.095e-02 1.952e-02 4.147 7.48e-05 ***
## ggacpe 4.069e-05 3.026e-05 1.345 0.181966
## initcirc 2.525e-05 4.359e-06 5.794 9.54e-08 ***
## typeS -4.876e+00 1.210e+00 -4.029 0.000115 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.874 on 92 degrees of freedom
## Multiple R-squared: 0.6186, Adjusted R-squared: 0.5979
## F-statistic: 29.85 on 5 and 92 DF, p-value: < 2.2e-16
pred_explm <- predict(mod_explm, newdata = uva_explm)
compare(pred_totexp, uva_explm$explm/1e6)
## Predicted: $27.78
## Actual: $14.03
# also try msda in place of gradstu