Only need help with the last question (number 5) the graphs and logistic regression need to be done with R. Both the R codes and the justification of the answers and the methods used are required....

1 answer below »
Only need help with the last question (number 5)
the graphs and logistic regression need to be done with R. Both the R codes and the justification of the answers and the methods used are required.



Document Preview:

Homework 6 Stat 135, summer 2012 Due in class, Monday 6th August 1. Rice (3rd ed.) 14.8 2. Rice 14.10 3. Rice 14.20 4. Rice 14.22 5. In the 2000 Presidential election, who voted for Bush? Who voted for Gore? The data are on bSpace. The variables into the data set are:  vote: 0 = Gore, 1 = Bush, NA = other or didn't vote  female: 0 = male, 1 = female  age: 1 = 18-29, 2 = 30-44, 3 = 45-64, 4 = 65+  race: 0 = white, 0.5 = other, 1 = black  income: 1 = 0th-16th percentile, 2 = 17th-33rd percentile, 3 = 34th-67th percentile, 4 = 68th-95th percentile, 5 = 96th-100th percentile  educ: 1 = no high school, 2 = high school grad, 3 = some college, 4 = college grad  party: 1 = strong Democrat, 2 = Democrat, 3 = weak Democrat, 4 = independent, 5 = weak Republican, 6 = Republican, 7 = strong Republican  ideo: 1 = strong liberal, 7 = strong conservative Analyses you might consider performing include:  Histograms or other graphs comparing Bush voters to Gore voters  Single-variable logistic regressions  Multivariate logistic regressions  Multivariate logistic regression with interaction  Even more advanced models, e.g. the generalized additive model.  Plots of tted curves for your nal model  Plots of residuals or deviances You don't have to do all of these, but you should do most of them. You should hand in: 1 A model that gives a predicted probability of a voter in the 2000 Presidential election voting for Bush or Gore (you can ignore votes for Nader etc.)  A justi cation of why you chose that model.  Graphs or other analyses that show how well the model ts.  A concise description of how the variables in the data set a ect the predicted probability of voting for Bush.  R code as an appendix. You will lose points if you put unnecessary R code in the body of your assignment. 2



Answered Same DayDec 23, 2021

Answer To: Only need help with the last question (number 5) the graphs and logistic regression need to be done...

Robert answered on Dec 23 2021
119 Votes
The following pie chart shows the proportion of votes: 0 = Gore, 1 = Bush.
The following output shows the results for logistic regression:
Call: glm(fo
rmula = vote ~ factor(female) + factor(age) + factor(race) +
factor(income) + factor(educ) + factor(party) + factor(ideo),
family = binomial, data = x)
Coefficients:
(Intercept) factor(female)1 factor(age)2 factor(age)3 factor(age)4
-18.11645 0.35585 0.85359 -0.01217 0.54698
factor(race)0.5 factor(race)1 factor(income)2 factor(income)3 factor(income)4
0.88634 -0.17870 1.98200 0.96453 1.03571
factor(income)5 factor(educ)2 factor(educ)3 factor(educ)4 factor(party)2
1.71690 0.75497 0.63754 -0.41064 1.42847
factor(party)3 factor(party)4 factor(party)5 factor(party)6 factor(party)7
2.42883 2.91336 5.00511 5.87317 6.83336
factor(ideo)2 factor(ideo)3 factor(ideo)4 factor(ideo)5 factor(ideo)6
10.57590 11.14530 12.11315 12.73324 13.83929
factor(ideo)7
13.48345
Degrees of Freedom: 363 Total (i.e. Null); 338 Residual
(497 observations deleted due to missingness)
Null Deviance: 504.1
Residual Deviance: 189.9 AIC: 241.9
Here we have used logistic regression model since the response variable – “vote” is a binary response
variable.
>...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here