knitr::opts_chunk$set(echo = TRUE)
Add text here
Total expenditures: Add more text here
mod_totexp <- lm(totexp/1e6 ~ initcirc + law + phdfld + msda + fac + irpgg,
data = arl_totexp)
summary(mod_totexp)
##
## Call:
## lm(formula = totexp/1e+06 ~ initcirc + law + phdfld + msda +
## fac + irpgg, data = arl_totexp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -28.7537 -4.2685 0.0145 3.6981 25.0966
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.662e-01 2.128e+00 -0.172 0.8637
## initcirc 4.593e-05 7.641e-06 6.011 3.77e-08 ***
## law1 4.869e+00 1.927e+00 2.526 0.0133 *
## phdfld 8.014e-02 3.496e-02 2.292 0.0242 *
## msda 1.323e-03 7.249e-04 1.825 0.0713 .
## fac 2.224e-03 1.047e-03 2.125 0.0363 *
## irpgg 1.157e-08 1.161e-09 9.973 2.90e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 7.942 on 91 degrees of freedom
## Multiple R-squared: 0.8179, Adjusted R-squared: 0.8059
## F-statistic: 68.13 on 6 and 91 DF, p-value: < 2.2e-16
pred_totexp <- predict(mod_totexp, newdata = uva_totexp)
compare(pred_totexp, uva_totexp$totexp/1e6)
## Predicted: $35.16
## Actual: $40.03
# also try msda in place of gradstu
Materials Expenditures: add more text here
mod_explm <- lm(explm/1e6 ~ initcirc + law + phdfld + msda + fac + irpgg,
data = arl_explm)
summary(mod_explm)
##
## Call:
## lm(formula = explm/1e+06 ~ initcirc + law + phdfld + msda + fac +
## irpgg, data = arl_explm)
##
## Residuals:
## Min 1Q Median 3Q Max
## -14.7320 -2.1568 -0.4108 1.8806 11.9938
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.687e+00 1.037e+00 1.626 0.107339
## initcirc 1.338e-05 3.726e-06 3.591 0.000533 ***
## law1 2.401e+00 9.398e-01 2.555 0.012276 *
## phdfld 4.522e-02 1.705e-02 2.652 0.009429 **
## msda 5.627e-04 3.535e-04 1.592 0.114887
## fac 3.255e-04 5.104e-04 0.638 0.525186
## irpgg 5.368e-09 5.659e-10 9.485 3.04e-15 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.873 on 91 degrees of freedom
## Multiple R-squared: 0.7618, Adjusted R-squared: 0.7461
## F-statistic: 48.5 on 6 and 91 DF, p-value: < 2.2e-16
pred_explm <- predict(mod_explm, newdata = uva_explm)
compare(pred_explm, uva_explm$explm/1e6)
## Predicted: $16.07
## Actual: $14.03
# also try msda in place of gradstu