Question

In: Statistics and Probability

Go into R and view all of the data sets preloaded in R by using the...

Go into R and view all of the data sets preloaded in R by using the data() command. As you see there are quite a few data sets loaded into R. Now retrieve the dataset women using data(women). This data is from a random sample of 15 women, recording the height and weight of each woman in the sample. I want you to create a 95% confidence interval for the population mean using this data and R.

First find the sample mean using the mean() command and sample standard deviation using the sd() command. Now find t* using the qt() function. Look up help for this function to learn how to use it. Remember that for a 95% CI value, t* you want to find the value t for which P(T14 < t∗) = .975. Construct the margin of error using the R math functions. Now find the upper and lower ends of the confidence interval.

Now go to R help and look up the t.test function. Use the t.test to conduct the hypothesis testH0 : μ = 62.5 with Ha : μ ̸= 62.5. For this application, use women$height in place of x, mu=62.5 for the 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 the condfidence interval you constructed earlier? Now pick any value that falls inside the confidence interval you constructed. Conduct the t-test on that as the null value and report the p-value. Try other null values that fall inside your CI and conduct the t-test on these. What is the relationship between a 95% CI and a two-sided hypothesis test withα = .05?

Solutions

Expert Solution

R codes and output:

> data(women)
> women
height weight
1 58 115
2 59 117
3 60 120
4 61 123
5 62 126
6 63 129
7 64 132
8 65 135
9 66 139
10 67 142
11 68 146
12 69 150
13 70 154
14 71 159
15 72 164
> attach(women)
The following objects are masked from women (pos = 3):

height, weight

> m=mean(height);m
[1] 65
> s=sd(height);s
[1] 4.472136
> t=qt(0.975,14);
> me=t*s/sqrt(15);me
[1] 2.476586
> LL = m -me; LL
[1] 62.52341
> UL = m +me;UL
[1] 67.47659

Confidence interval:

Lower Limit = 62.52341

Upper limit = 67.47659


> t.test(height,mu=62.5,alternative='two.sided')

One Sample t-test

data: height
t = 2.1651, df = 14, p-value = 0.04815
alternative hypothesis: true mean is not equal to 62.5
95 percent confidence interval:
62.52341 67.47659
sample estimates:
mean of x
65

P-value is 0.04815 which is less than 0.05, hene we reject null hypothesis and conclude that mean height not equal to 62.5

μ = 62.5 does not fall in the confidence interval ccomputed above.

Let μ = 63

> t.test(height,mu=63,alternative='two.sided')

One Sample t-test

data: height
t = 1.7321, df = 14, p-value = 0.1052
alternative hypothesis: true mean is not equal to 63
95 percent confidence interval:
62.52341 67.47659
sample estimates:
mean of x
65

Let μ = 62.7


> t.test(height,mu=62.7,alternative='two.sided')

One Sample t-test

data: height
t = 1.9919, df = 14, p-value = 0.06626
alternative hypothesis: true mean is not equal to 62.7
95 percent confidence interval:
62.52341 67.47659
sample estimates:
mean of x
65

From above two test we see that if mu fall in the confidence interval then p-value is greater than alpha(0.05).

Hence we accept null hypothesis in both the cases.


Related Solutions

Using all the data below, construct an empirical model using a computational tool (matlab, or R,...
Using all the data below, construct an empirical model using a computational tool (matlab, or R, any preferred). explain your model. Data Description: These data are from a NIST study involving calibration of ozone monitors. The response variable (y) is the customer's measurement of ozone concentration and the predictor variable (x) is NIST's measurement of ozone concentration. MATLAB Row Vectors: xLst = [0.2, 337.4, 118.2, 884.6, 10.1, 226.5, 666.3, 996.3, 448.6, 777.0, 558.2, 0.4, 0.6, 775.5, 666.9, 338.0, 447.5, 11.6,...
In R, Use library(MASS) to access the data sets for this test. Use the Pima.tr data...
In R, Use library(MASS) to access the data sets for this test. Use the Pima.tr data set to answer questions 1-5. What is the average age for women in this data set? What is the maximum number of pregnancies for women in this data set ? What is the median age for women who have diabetes? What is the median age for women who do not have diabetes? What is the third quartile of the skin variable?
Given two sets of data, A and B. i) Data set A has an r value...
Given two sets of data, A and B. i) Data set A has an r value of -.81 and data set B has an r value of .94 Describe the differences between the two data sets as completely as you can using the regression information we have learned. ii) Which linear regression equation, the one for A or the one for B, would probably be a better predictor? Why?
1. Where can you go to view a list of all FactSet hotkeys? A. Excel >...
1. Where can you go to view a list of all FactSet hotkeys? A. Excel > FactSet ribbon > Settings > Spreadsheet Tools B. Excel > FactSet ribbon > Settings > Modeling Tools C. Excel > FactSet ribbon > Settings > Manage Hotkeys D. Excel > FactSet ribbon > Help > FactSet’s Excel Tips and Tricks 2. What hotkey modifies a formula in the Edit tab of Sidebar? A. CTRL+M B. CTRL+J C. ALT+M D. ALT+N
Using Minitab and given the data sets below a) determine if there is a difference in...
Using Minitab and given the data sets below a) determine if there is a difference in the means at an alpha level 0.05; b) determine if the variability of data set A is larger. Data A Data B 35.8 40.9 40.4 35.7 30.3 36.7 46.8 37.3 34.1 41.8 34.0 39.9 39.1 34.6 45.0 38.8 41.9 35.8 40.2 35.6
(c) Compute the sample correlation coefficient r for each of the following data sets and show...
(c) Compute the sample correlation coefficient r for each of the following data sets and show that r is the same for both. (Use 3 decimal places.) (i) x 6 1 9 y 4 2 5 (ii)x 4 2 5 y6 1 9
If we have data sets in my computer .. How to use them in Microsoft R...
If we have data sets in my computer .. How to use them in Microsoft R without writing them? I know the code : data<- read.csv("c:\\data.csv",header =True) but I didn't know how to use it ..Can u explain that with take screenshot from your work..Thanks
Compute the sample correlation coefficient r for each of the following data sets. (Use 3 decimal...
Compute the sample correlation coefficient r for each of the following data sets. (Use 3 decimal places.) (a) x 5 8 9 y 2 2 5 (b) x 2 2 5 y 5 8 9 r(a) = r(b) = x 2 1 2 4 3 y 5 10 9 15 10 (a) Find the linear correlation coefficient r.
Are all data sets best described with graphs? Talk about when a data set might not...
Are all data sets best described with graphs? Talk about when a data set might not benefit from being displayed graphically.
Go Spurs Go! Construct a 95% confidence interval for the Spurs score using the data given...
Go Spurs Go! Construct a 95% confidence interval for the Spurs score using the data given in class. Given the results and their win loss record, can you make any conclusions about their offense/ defense in the year 2018? Support with EVIDENCE from the confidence interval! 116, 129, 120, 143,120,108,131,112,118,102,116,111,112,124,96,111,126,104,96,111,129,129,96,99,116,85,117,113
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT