Question: -Use the followingRcode to create the data and plot ofAgebySurvided. We will compare mean age of survived and non-survived group. (hint: you need to install

-Use the followingRcode to create the data and plot ofAgebySurvided. We will compare mean age of survived and non-survived group. (hint: you need to install the packages: "ggplot2", "dplyr", "tidyr", "titanic")

library(ggplot2)

library(dplyr)

library(tidyr)

library(titanic)

titanicData <-drop_na(titanic_train)

head(titanicData)

x1 <- titanicData$Age[titanicData$Survived==1]

x2 <- titanicData$Age[titanicData$Survived==0]

par(mfrow=c(2,1))

hist(x1,main="Survived",breaks=30)

hist(x2,main="Not Survived",breaks=30)

  • Calculate sample size, mean, SD for each groupx1(Survived) andx2(Not survived).
  • Let us denote1= mean forx1(Survived) and2= mean forx2(Not survived). Calculate 95% confidence intervals for each1and2.
  • Calculate 95% confidence intervals for the difference of means12.

-Do the test of the hypothesis

Use the significance level= 0.05.

H0:1=2vsH1:1=2.

-Do the test of the hypothesis

Use the significance level= 0.01.

H0:1=2vsH1:1<2.

-Find,and the power of the test for the hypothesis

H0:12=0vsH1:12=3.

at the significance level= 0.01.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!