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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started