In: Statistics and Probability
Hypothesis testing
For this problem, collect data on any variables of interest (sample size for each group of the two groups n=>30) and perform a two-sided significance test for comparing two independent population means. You can also simulate your own data.
Address the following:
a. A brief introductory paragraph describing the problem.
We consider the famous sleep dataset. In this test, there are two drugs and it is needed to find out which of them gives extra sleep. Each drug is tested on ten patients.
b. Set up your framework in a null and alternative hypothesis using symbols and notation as they are presented in the textbook. Should have the general set-up of H0: µ1 = µ2 H1: can have a <, or >, or ≠ depending on your question.
Let denote the average sleep induced by drugs 1 and 2 respectively. We need to test the null hypothesis against the alternative .
c. A paragraph describing how you collected the data (i.e., the number of observations, time of day, etc. Please present the data in a table. Also, in this section, please plot the means of the two samples using Excel.
The data appears in Student's famous 1908 paper. The dataset is given below:
> sleep
extra group ID
1 0.7 1 1
2 -1.6 1 2
3 -0.2 1 3
4 -1.2 1 4
5 -0.1 1 5
6 3.4 1 6
7 3.7 1 7
8 0.8 1 8
9 0.0 1 9
10 2.0 1 10
11 1.9 2 1
12 0.8 2 2
13 1.1 2 3
14 0.1 2 4
15 -0.1 2 5
16 4.4 2 6
17 5.5 2 7
18 1.6 2 8
19 4.6 2 9
20 3.4 2 10
e. A section explaining the results of the analysis (calculated statistics, and p-values). Based on what you find, state your decision (whether you reject or fail to reject the H0) and conclusion (whether you have sufficient or insufficient evidence for H1).
We perform the t-test.
> with(sleep,
+ t.test(extra[group == 1],
+
extra[group == 2], paired = TRUE))
Paired t-test
data: extra[group == 1] and extra[group == 2]
t = -4, df = 9, p-value = 0.003
alternative hypothesis: true difference in means is not equal to
0
95 percent confidence interval:
-2.46 -0.70
sample estimates:
mean of the differences
-1.58
We reject the null hypotesis and conclude that the extra sleep is different for two drugs.
f. Describe how would you change the experimental design to become dependent or related samples? Think about which factors you could possibly control for that weren’t in the initial analysis.
Suppose that the first five observations were male and the next were females. Then, the additional information can be used to find if the drugs have equal effect in some partitions of the population.