In: Statistics and Probability
*Using the am column of the mtcars data, test the hypothesis that the true proportion of automatic cars is .62 at the .01 significance level. Please not that am = 0 stands for automatic, while am = 1 stands for manual.*
Please make sure you solve in R-studio. Solving without giving me R-codes will not help me. It would also help if you write a brief explanation of what you did. Thanks in advance!
The R code is
auto=mtcars$am#Extracting column am from mtcars dataset and
saved in auto vector
X=sum(auto==0)# for total number of observation are automatic
N=length(auto)#Total number of observation in am column
#The Null and alternative hypothesis are Ho:P=0.62 Vs H1:P ≠
0.62
P=0.62 # Testing the true proportion of automatic
alpha=0.01 # level of significance
Test=prop.test(X,N,P,conf.level=1-alpha) # prop.test() is command
for testing the proportion
Test
The Output of code is
>auto=mtcars$am#Extracting column am from mtcars dataset and
saved in auto vector
>X=sum(auto==0)# number of observation are automatic
>N=length(auto)#Total number of observation in in am
column
>#The Null and alternative hypothesis are Ho:P=0.62 Vs H1:P ≠
0.62
>P=0.62 # Testing the true proportion of automatic
>alpha=0.01 # level of significance
>Test=prop.test(X,N,P,conf.level=1-alpha) # prop.test() is
command for testing the proportion
>Test
#Since it is observed that p-value=0.9015>alpha=0.01
Then we fail to reject the Null hypothesis Ho
And conclude that There is enough evidence to claim the true proportion is 0.62
The image of output is