GV900: Political Explanation - Titanic - R Programming Assignment Help

Download Solution Order New Solution

R Programming Assignment Help

Assignment Task: Tasks 1. Use the revised Titanic data set (it's called titanic2.csv, not titanic.csv) to do the following. (a).  Estimate a logit model of passenger survival where survived is the dependent vari- able and fare, female, and child are the independent variables. (b). The fare variable is highly right-skewed (you could see this if you draw a histogram of it). That is, more than 80% of the passengers have a ticket worth less than 50 pounds, and less than 10% of the passengers have a ticket worth more than 100 pounds. When an independent variable is right-skewed, we should try including the log transformed variable instead of the original variable to construct a better- tting model. Estimate another logit model by including the natural log of the fare variable instead of the original fare variable. Hint 1: the range of the fare variable is between 0 and 512. Since log(0) is unde ned, use log(fare + 1) instead. Hint 2: you should use the I() function when including the logged fare variable in a regression model (i.e., rather than creating a logged variable manually before estimation). This is to make the graphical interpretation (which we will do later) easier. (c). Produce a stargazer table summarizing the results from the two models estimated above. (d). According to the model t statistics, which model performs the better? Provide your answer in your R le as a comment. It goes without saying that you need to tell me the basis of your judgement as well. Your explanation here could be very brief (one sentence will do). (e). Produce two effect graphs that show the substantive  of fare on passenger survival, one based on the rst model and the other based on the second model, holding all the other independent variables constant at their median value. (f). Compare the two graphs. Both graphs are somewhat non-linear, but one graph is more linear than the other (i.e., one graph is more non-linear than the other). The two graphs thus tell us different stories about the marginal of fare on passenger survival. Discuss this di erence (provide your answer in your R le as a comment) in ve sentences (You will lose points if you have more than ve sentences or less than ve sentences). Your discussion should have the following structure. Say something along the lines of: \The graph with the original fare variable suggests that the  of fare on survival is linear / non-linear (choose one). That is, (explain what a linear or non-linear relationship means in this context). On the other hand, the graph with the logged fare variable suggests that the effect of fare is linear / non- linear (choose one). That is (explain what a linear / non-linear relationship means in this context). Based on the model t statistics, we should believe the rst / second (choose one) story to be more plausible." (g). One way to understand the substantive importance of the fare variable would be to see how much this variable improves predictive abilities of the models. We can do so by comparing ROC curves with and without the logged fare variable. To do so, let's rst estimate a logit model that does not include the logged fare variable while retaining the female and child variables. (h). Produce a stargazer table that contrasts the models you estimated in 1-(g) and another model that includes logged fare, female, and child. (i). Produce a graph for ROC curves for these two models (i.e., the model that includes logged fare and the model that does not include fare). (k). Based on the ROC curves and AUC scores you produced in 1-(i) and 1-(j), which model performs better? Your answer must be based on your interpretation of the\ ROC curves and/or the AUC scores (both will lead you to the same conclusion).
This GV900: R Programming Assignment has been solved by our  R Programming experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.