Question: Can this please be shown in google collab Consider the titanic dataset titanic.csv. This dataset includes the following variables: Name: The names of the passengers
Can this please be shown in google collab
Consider the titanic dataset "titanic.csv". This dataset includes the following variables:
Name: The names of the passengers PClass: Passenger class: 1st, 2nd, 3rd Age: Age in years Sex: Male or Female
2
Survived: 1 = Yes, 0 = No
a. To avoid confusion later, turn "Survived" 1 into "Yes" and "Survived" 0 into "No". Turn the data into a contingency table, where passenger class is across the top, and survival is down the side. Make sure totals are displayed.
b. Calculate the conditional distribution of survival given passenger class.
c. Please generate a bar plot for the above conditional distribution, with passenger class on the x axis, and survival in the legend.
d. From (b) and (c), what can you say about the relationship between survival and
passenger class?
e. Please generate another contingency table, this time, sex is along the top, and survival is
down the side.
f. Calculate the conditional distribution of survival given sex.
g. Please Generate a bar plot for the above conditional distribution, with sex on the x axis, and survival in the legend.
h. From (f) and (g), what can you say about the relationship between survival and sex?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
