Highlights
Use the revised Titanic data set (it’s called titanic2.csv, not titanic.csv) to do the following
Estimate a logit model of passenger survival where survived is the dependent variable and fare, female, and child are the independent variables.
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-fitting model. Estimate another logit model by including the natural log of the fare variable instead of the original fare variable.
Produce a stargazer table summarizing the results from the two models estimated above.
According to the model fit statistics, which model performs the better? Provide your answer in your R file 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).
Produce two effect graphs that show the substantive effect of fare on passenger survival, one based on the first model and the other based on the second model, holding all the other independent variables constant at their median value.
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 effect of fare on passenger survival. Discuss this difference (provide your answer in your R file as a comment) in five sentences (You will lose points if you have more than five sentences or less than five sentences). Your discussion should have the following structure. Say something along the lines of: “The graph with the original fare variable suggests that the effect 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 nonlinear (choose one). That is (explain what a linear / non-linear relationship means in this context). Based on the model fit statistics, we should believe the first second (choose one) story to be more plausible.
One way to evaluate the substantive importance of the fare variable would be to see how much this variable improves predictive abilities of the models in the outof-sample setting. We can do so by comparing ROC curves with and without the logged fare variable. To do so, let’s first estimate a logit model in the training set that does not include the logged fare variable while retaining the female and child variables. Most importantly, you need to subset the data into a training (80 % of the original data) and a test set (20 % of the original data) in order to do out-of-sample prediction.
Produce a stargazer table that contrasts the models you estimated in 1-(g) and another model that includes logged fare, female, and child.
Produce a graph for ROC curves for these two models as your prediction result (i.e., the model that includes logged fare and the model that does not include fare).
Report AUC scores for the two models. That is, write a command that gives us AUC scores for the two models.
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). Provide your answer in your R file as a comment. This could be very brief (two or three sentences will do).
This GV900 – Statistics has been solved by our PHD Experts at My Uni Paper.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.