Problem 2

Reload the Glucose Tolerance Test data used earlier.

The Glucose2 dataframe has three columns, one for each of three pregnancies.

For the first two columns, test1 and test2, test the hypothesis of no change, using the paired t-test. Do the differences appear to be approximately normally distributed?

For bootstrapping a paired sample, we need to select the subjects, not individual values, since the values come paired by subject. For the Glucose2 dataset, there are 52 subjects. To select a single bootstrap sample of size 52 from the 52 subjects, use:

n <- sample(1:52,replace=T)
Then, for example, test1[n] and test2[n] are corresponding pairs of observations, and mean(test2[n]-test1[n]) returns the mean difference for the bootstrap sample. Alternatively, one could make a dataset containing the differences (test1-test2), and resample that dataset.

Construct a 95% CI using the bootstrap, based on at least 20000 bootstrap trials.

Do the t-test and bootstrap analyses agree? If not, on which should we base our conclusions and why? What should we conclude?