436 or square root of sum of squared residualsvalid

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ers. Hint: Both numbers come out of summary(lm1) (if your lm object is called lm1). Here is my version: ## The R-squared with(nes08.df, var(fitted(lm1))/var(relig.money, na.rm = TRUE)) [1] 0.00187 Class 12 — Political Science 230 An Interlude about Data and Final Reports— October 8, 2013— 3 ## The typical variation in residuals: standard deviation of the residuals sd(residuals(lm1)) [1] 0.436 ## or: square root of sum of squared residuals/valid sample size minus 1 sqrt(sum(residuals(lm1)^2)/(length(residuals(lm1)) - 1)) [1] 0.436 ## A slightly different measure of fit: residual standard error differs from sd in that it adjusts for number of coefficients ## estimated: sqrt(sum(residuals(lm1)^2)/(length(residuals(lm1)) - length(coef (lm1)))) [1] 0.436 My model does not fit very well: only about .2 % of the variation in the outcome is captured by the fitted model and the typical residual is about .4 — which is a lot when the outcome is 0 or 1 [i.e. it would not be surprising to find a residual as big as .4 from the fitted line — if the line were exactly flat and showing no relationship and in the middle of the points at .5, we would expect residuals to be .5] 8. Congratulations! You’ve just done about half of what will be required for the final paper for this class. The other half will involve, roughly speaking, (1) finding a dataset with variables that appeals to you rather than using one that I chose; (2) actually writing some paragraphs to explain your expectations, model, analysis, results, and conclusions; (3) using R to illustrate the expectations part rather than drawing it by hand; (4) choosing a third variable to estimate the partial relationship between your explanatory and outcome variables (to clarify the effect of your explanatory on the outcome); (5) interpreting the regression coefficients as telling us something about partial relationships; and (6) discussing relevant hypothesis tests and confidence intervals related to your expectations. Class 12 — Political Science 230 An Interlude about Data and Final Reports— October 8, 2013— 4...
View Full Document

This note was uploaded on 02/07/2014 for the course PS 230 taught by Professor Staff during the Fall '08 term at University of Illinois, Urbana Champaign.

Ask a homework question - tutors are online