a) Calculate sample size, mean, SD for each group x1 (Survived) and x2 (Not survived). b) Let us denote μ1= mean for x1 (Survived) and μ2 = mean for x2 (Not survived). Calculate 95% confidence intervals for each μ1 and μ2. c) Calculate 95% confidence intervals for the difference of means μ1 − μ2. d) Do the test of the hypothesis  H0 : μ1 = μ2 vs H1 : μ1 ≠ μ2. Use the significance level α = 0.05.   e) Do the test of the hypothesis H0 : μ1 = μ2 vs H1 : μ1 < μ2. Use the significance level α = 0.01.   f) Find β and the power of the test for the hypothesis H0 : μ1 − μ2 = 0 vs H1 : μ1 − μ2 = −3. at the significance level α = 0.01.

MATLAB: An Introduction with Applications
6th Edition
ISBN:9781119256830
Author:Amos Gilat
Publisher:Amos Gilat
Chapter1: Starting With Matlab
Section: Chapter Questions
Problem 1P
icon
Related questions
Question

a) Calculate sample size, mean, SD for each group x1 (Survived) and x2 (Not survived).

b) Let us denote μ1= mean for x1 (Survived) and μ2 = mean for x2 (Not survived). Calculate 95% confidence intervals for each μ1 and μ2.

c) Calculate 95% confidence intervals for the difference of means μ1 − μ2.

d) Do the test of the hypothesis

 H0 : μ1 = μ2 vs H1 : μ1 ≠ μ2.

Use the significance level α = 0.05.

 

e) Do the test of the hypothesis

H0 : μ1 = μ2 vs H1 : μ1 < μ2.

Use the significance level α = 0.01.

 

f) Find β and the power of the test for the hypothesis

H0 : μ1 − μ2 = 0 vs H1 : μ1 − μ2 = −3.

at the significance level α = 0.01.

Q1.
Use the following R code to create the data and plot of Age by Survided. We will compare mean age of
survived and non-survived group.
library(ggplot2)
library (dplyr)
library (tidyr)
library(titanic)
titanicData <- drop_na (titanic_train)
head (titanicData)
PassengerId Survived Pclass
## 1
1
## 2
2
1
1
## 3
3
1
3
## 4
4
1
## 5
5
3
## 6
7
1
##
Name
Sex Age SibSp Parch
## 1
Braund, Mr. Owen Harris
male 22
1
## 2 Cumings, Mrs. John Bradley (Florence Briggs Thayer) female 38
Heikkinen, Miss. Laina female 26
1
## 3
Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35
Allen, Mr. William Henry
McCarthy, Mr. Timothy J
## 4
1
## 5
male 35
## 6
male 54
##
Ticket
Fare Cabin Embarked
## 1
A/5 21171 7.2500
S
## 2
PC 17599 71.2833
C85
## 3 STON/02. 3101282 7.9250
S
## 4
113803 53.1000 C123
S
## 5
373450 8.0500
S
## 6
17463 51.8625
E46
x1 <- titanicData$Age [titanicData$Survived=31]
x2 <- titanicData$Age [titanicData$Survived==0]
par (mfrow=c (2,1))
hist (x1, main="Survived", breaks=30)
hist (x2, main="Not Survived" , breaks=30)
Transcribed Image Text:Q1. Use the following R code to create the data and plot of Age by Survided. We will compare mean age of survived and non-survived group. library(ggplot2) library (dplyr) library (tidyr) library(titanic) titanicData <- drop_na (titanic_train) head (titanicData) PassengerId Survived Pclass ## 1 1 ## 2 2 1 1 ## 3 3 1 3 ## 4 4 1 ## 5 5 3 ## 6 7 1 ## Name Sex Age SibSp Parch ## 1 Braund, Mr. Owen Harris male 22 1 ## 2 Cumings, Mrs. John Bradley (Florence Briggs Thayer) female 38 Heikkinen, Miss. Laina female 26 1 ## 3 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35 Allen, Mr. William Henry McCarthy, Mr. Timothy J ## 4 1 ## 5 male 35 ## 6 male 54 ## Ticket Fare Cabin Embarked ## 1 A/5 21171 7.2500 S ## 2 PC 17599 71.2833 C85 ## 3 STON/02. 3101282 7.9250 S ## 4 113803 53.1000 C123 S ## 5 373450 8.0500 S ## 6 17463 51.8625 E46 x1 <- titanicData$Age [titanicData$Survived=31] x2 <- titanicData$Age [titanicData$Survived==0] par (mfrow=c (2,1)) hist (x1, main="Survived", breaks=30) hist (x2, main="Not Survived" , breaks=30)
Survived
20
40
60
80
х1
Not Survived
20
40
60
x2
Frequency
Frequency
0 30
Transcribed Image Text:Survived 20 40 60 80 х1 Not Survived 20 40 60 x2 Frequency Frequency 0 30
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Please do the remaining questions 

d) Do the test of the hypothesis

 H0 : μ1 = μ2 vs H1 : μ1 ≠ μ2.

Use the significance level α = 0.05.

 

e) Do the test of the hypothesis

H0 : μ1 = μ2 vs H1 : μ< μ2.

Use the significance level α = 0.01.

 

f) Find β and the power of the test for the hypothesis

H0 : μ1 − μ2 = 0 vs H1 : μ1 − μ2 = −3.

at the significance level α = 0.01.

Use the following R code to create the data and plot of Age by Survided. We will compare mean age of
survived and non-survived group.
library(ggplot2)
library(dplyr)
library(tidyr)
library (titanic)
titanicData <- drop_na(titanic_train)
head (titanicData)
PassengerId Survived Pclass
3
##
## 1
## 2
1
1
## 3
## 4
1
1
## 5
3
9 ##
##
1
Sex Age SibSp Parch
male 22
Name
## 1
Braund, Mr. Owen Harris
1
## 2 Cumings, Mrs. John Bradley (Florence Briggs Thayer) female 38
Heikkinen, Miss. Laina female 26
1
## 3
Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35
Allen, Mr. William Henry
McCarthy, Mr. Timothy J
## 4
1
## 5
male 35
9 ##
##
male 54
Ticket
Fare Cabin Embarked
## 1
A/5 21171 7.2500
S
## 2
PC 17599 71.2833
C85
## 3 STON/02. 3101282 7.9250
S
## 4
113803 53.1000 C123
S
## 5
373450 8.0500
S
## 6
17463 51.8625
E46
S
x1 <- titanicData$Age [titanicData$Survived=%31]
x2 <- titanicData$Age[titanicData$Survived==0]
par (mfrow=c (2,1))
hist (x1, main="Survived", breaks=30)
hist (x2, main="Not Survived" , breaks=30)
123 457
Transcribed Image Text:Use the following R code to create the data and plot of Age by Survided. We will compare mean age of survived and non-survived group. library(ggplot2) library(dplyr) library(tidyr) library (titanic) titanicData <- drop_na(titanic_train) head (titanicData) PassengerId Survived Pclass 3 ## ## 1 ## 2 1 1 ## 3 ## 4 1 1 ## 5 3 9 ## ## 1 Sex Age SibSp Parch male 22 Name ## 1 Braund, Mr. Owen Harris 1 ## 2 Cumings, Mrs. John Bradley (Florence Briggs Thayer) female 38 Heikkinen, Miss. Laina female 26 1 ## 3 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35 Allen, Mr. William Henry McCarthy, Mr. Timothy J ## 4 1 ## 5 male 35 9 ## ## male 54 Ticket Fare Cabin Embarked ## 1 A/5 21171 7.2500 S ## 2 PC 17599 71.2833 C85 ## 3 STON/02. 3101282 7.9250 S ## 4 113803 53.1000 C123 S ## 5 373450 8.0500 S ## 6 17463 51.8625 E46 S x1 <- titanicData$Age [titanicData$Survived=%31] x2 <- titanicData$Age[titanicData$Survived==0] par (mfrow=c (2,1)) hist (x1, main="Survived", breaks=30) hist (x2, main="Not Survived" , breaks=30) 123 457
Survived
20
40
60
80
х1
Not Survived
20
40
60
x2
Frequency
Frequency
0 30
0 20
Transcribed Image Text:Survived 20 40 60 80 х1 Not Survived 20 40 60 x2 Frequency Frequency 0 30 0 20
Solution
Bartleby Expert
SEE SOLUTION
Similar questions
Recommended textbooks for you
MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
Statistics
ISBN:
9781119256830
Author:
Amos Gilat
Publisher:
John Wiley & Sons Inc
Probability and Statistics for Engineering and th…
Probability and Statistics for Engineering and th…
Statistics
ISBN:
9781305251809
Author:
Jay L. Devore
Publisher:
Cengage Learning
Statistics for The Behavioral Sciences (MindTap C…
Statistics for The Behavioral Sciences (MindTap C…
Statistics
ISBN:
9781305504912
Author:
Frederick J Gravetter, Larry B. Wallnau
Publisher:
Cengage Learning
Elementary Statistics: Picturing the World (7th E…
Elementary Statistics: Picturing the World (7th E…
Statistics
ISBN:
9780134683416
Author:
Ron Larson, Betsy Farber
Publisher:
PEARSON
The Basic Practice of Statistics
The Basic Practice of Statistics
Statistics
ISBN:
9781319042578
Author:
David S. Moore, William I. Notz, Michael A. Fligner
Publisher:
W. H. Freeman
Introduction to the Practice of Statistics
Introduction to the Practice of Statistics
Statistics
ISBN:
9781319013387
Author:
David S. Moore, George P. McCabe, Bruce A. Craig
Publisher:
W. H. Freeman