Money freemktvsgovt data nes08df coef lm1 intercept

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: er than attempting to directly interpreting the coefficients. You'd do something like lm1 <- lm(y ~ x + I(x^2), data = thedata) preddata <- data.frame(x = sort(unique(thedata$x))) preddata$predy <- predict(lm1, newdata = preddata) ## And then either plot or print preddata to see the relationship between x and y lm1 <- lm(relig.money ~ freemkt.vs.govt, data = nes08.df) coef (lm1) (Intercept) freemkt.vs.govt 0.7326 0.0427 People who think that the free market should solve big economic problems are slightly more likely to have given money to a religious organization. The difference in proportion giving money is about .04: About 73% of strong-govt solution supporters have given money to religious organizations but about 73.3+4.3 ≈ 78% of free-market solution supporters have given money to religious organizations. (Notice that when we have a binary outcome, we interpret the coefficients in “proportions” because the mean of a binary variable is the proportion of “1”s.) 6. Make a scatterplot of the variables you chose and overlay the model values from the model you fit just now. Does your model fit to the data support your expectations? Or cause you to doubt them? Hint: Say you saved your model fit as lm1. You can do the following to make this plot (using y and x and mydata to stand in for your variables and the nes dataset (although you may need to use the predict() based method below depending on your model): 0.8 q 0.6 0.4 0.2 0.0 Ever Gave Money to Relig Org (No or Yes) q q q q q q q q qq qq qq q qq q qq q qq q q q q qqq q q q qq q q q qq q q qq qqq q qq q q q q q qq qq q q q q qqq q q q q qq q qq qqqq qqq q q q q q q qqq q q q q qq q q q qq q q q qq q q qq qq q qqq q q q qq q q qq qq qq q q q q qqq q qq qq qq q q q q qq q q q q qq q q q q q q q qqq q q qq q q qq q q q qq q q q qq q q q q q q q qq q qq q q q q q q q q q q q qq q qq qq q q q q q qq q q q qq q q q q q q qq q q q q qq q q q qq qq q q q q q q qqqq q q qq q q qq qq q q q qq q q q q q q q qqqq q qq q q q q q qq qq q q qq q q qq q qq q q q q q qq q q q qq q q q q q q q qq q q qq q qq qq q q q q q q q q q qq qq q q qq q q q qq q q qq q qq q q q q q q qq q q q qq qq q q qq q q q qq q q q qq q q q q q qq q q q q q qq q q qqq q q q q q q q q qq qq q q q qq qqq qq q q qq q qqqq q qq q qq q q q qq q q q qq q q q q q qq q q q q qqqq qq q q q qq q q qq q q q q q q qq q qqq qq q qqqq qqqqq q q q qq q q qqq q q q q q qq qq q q q qq q q q q qq q q qq q q q qq q q q q q q qq q qqq q qq q q q q q qqq q q q qq qq qq q q qq q qq qqq q q qq qq q q q qq q q q q qq qq q q qqq q qq qqq q q q qq q q qq q q q q q q q qq qqq qqqqqqqq q qq q qqqq q qq q q q q q qqq q q q qqq qqq q q q qq q qq q qq q qq q q q q qq q q q q q q q qq q q qqqqq qqqqq qq qqq q q q q q q qq q q q qq q qq qq q qq q qq qqq q qq q q q qqqq qq qq q qqq q qqq q q qqqqqq qq qq qq q q q q q qqq qq q qq q q qq q q qq qq qq q qq q qqqqqq qq q q q q qq qqq q qq qqq q q q q qq qqq q q qq q q qqq q q q q q q qq q q q qq q q q q q qqq q qq q qq qq q q q qq q qqq q qqqqq q q qq q qqqqq qq qq q q q q q q qqqq q q qqqqqqq q q q q q qqq q qq q q q qq q qq q q qq q qq q q q q q qq q q qqq qq q q q q qqq q q q qq q...
View Full Document

Ask a homework question - tutors are online