Go into R and view all of the data sets preloaded in R by usingthe data() command. As you see there are quite a few data setsloaded into R. Now retrieve the dataset women using data(women).This data is from a random sample of 15 women, recording the heightand weight of each woman in the sample. I want you to create a 95%confidence interval for the population mean using this data andR.
First find the sample mean using the mean() command and samplestandard deviation using the sd() command. Now find t* using theqt() function. Look up help for this function to learn how to useit. Remember that for a 95% CI value, t* you want to find the valuet for which P(T14 < t∗) = .975. Construct the margin of errorusing the R math functions. Now find the upper and lower ends ofthe confidence interval.
Now go to R help and look up the t.test function. Use the t.testto conduct the hypothesis testH0 : μ = 62.5 with Ha : μ ̸= 62.5.For this application, use women$height in place of x, mu=62.5 forthe second argument, and alternative=“two.sided†for the third.Interpret the p-value in terms of your typical test sizes.
Does the null hypothesis value H0 : μ = 62.5 fall in thecondfidence interval you constructed earlier? Now pick any valuethat falls inside the confidence interval you constructed. Conductthe t-test on that as the null value and report the p-value. Tryother null values that fall inside your CI and conduct the t-teston these. What is the relationship between a 95% CI and a two-sidedhypothesis test withα = .05?