
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

This assignment is about confidence intervals for a proportion as well as comparison of two independent samples. Some problems require the use of R, as it comes very handy to avoid tedious calculations.
caffeine=c(28,11,-3,14,-2,-4,18,2,2) (this is to load the data) decaf=c(26,1,0,-4,-4,14,16,8,0,18,-10) t.test(caffeine,decaf)
The last command will give you (among other things) a 95% confidence interval for the difference μcaffeine ā μdecaf. Try also
t.test(decaf,caffeine) It is about μdecaf ā μcaffeine instead. See what happens. The following command will get you a different confidence level: t.test(caffeine,decaf, conf.level=.80)
Plot a normal probability plot for each data set, with
qqnorm(caffeine) qqnorm(decaf) and determine whether the observations are approximately normally distributed, or at least not too much skewed to one side. Is the t-test valid here?
Readings:
Cecile Ane