Example: Two Sample t-Test
[This article was first published on ALSTAT R Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
The recovery time (in days) is measured for 10 patients taking a new drug and for 10 different patients taking a placebo. We wish to test the hypothesis that the mean recovery time for patients taking the drug is less than for those taking placebo. The data are:
Placebo: 15,14,12,8,14,7,16,10,15,12
A. Perform a hypothesis testing under an assumption of normality and equal population variances.
Solution:
Codes:
B. Perform a hypothesis testing under an assumption of normality and unequal population variances.
Solution:
Codes: (Using the defined data above)
Interpretation: Still, we lack the evidence to reject the null hypothesis at p = 0.3006, and so the true difference in mean recovery time for patients taking the drug is either equal to or greater than those taking a placebo.
To leave a comment for the author, please follow the link and comment on their blog: ALSTAT R Blog.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.