We will start with dependent samples first
The relationship between two samples is either independent or dependent. Thetwo samples are independent if individuals in each sample are completely independent or unrelated.
In Lab 9, we measure the heart rate of the same individuals before (sample A) and after (sample B) the exercise.
In a study of individuals’ age at marriage, husbands (sample A) and wives (sample B) are matched pairs.
If the two samples are dependent, we can take the difference between the matched pairs
And then perform one-sample inference (confidence interval or t-test) on the difference. (Paired t-test)
The differences are usually assumed to be normally distributed. We can check this by looking at a histogram.
or $$ \operatorname{Right\ tail:} H_a: \mu_d = \mu_1-\mu_2 > 0, $$ or $$ \operatorname{Two\ sided:} H_a: \mu_d = \mu_1-\mu_2 \neq 0 $$
Third, compute the test-statistic $t^∗$ through
$$t^* = \frac{\bar{x}_d - 0}{s_d / \sqrt{n}}$$
where $\bar{x}_d$ and $s_d$ are the sample mean and sample standard deviation of the differences, respectively.
$df = n-1$
Fourth step (the easier way), calculate p-value using statistical software (Stat Crunch, for this course).
Fifth, draw conclusion by comparing the P-value to the significance level α.
Suppose $\bar{x}_d$ and $s_d$ are the sample mean and sample standard deviation of the differences, respectively.
CI for $\mu_d = \mu_1 - \mu_2$ is given by
In clinical trials, individuals in the treatment group (sample $A$) and individuals in the placebo group (sample $B$) are independent.
We usually assume that the quantitative observations are randomly sampled from two normally distributed populations.
$A \sim \mathcal{N}(\mu_A, \sigma^2_A)$, $B \sim \mathcal{N}(\mu_B, \sigma^2_B)$
There are four unknown parameters, the two population means ($\mu_A$ and $\mu_B$) and the two population standard deviations ($\sigma_A$ and $\sigma_B$)
If the two sample variances are close enough, we can assume $\sigma_A = \sigma_B$ and perform pooled inference (pooled t-test).
Otherwise, assume $\sigma_A \neq \sigma_B$ and perform unpooled t-test
or $$ \operatorname{Right\ tail:} H_a: \mu_1-\mu_2 > 0, $$ or $$ \operatorname{Two\ sided:} H_a: \mu_1-\mu_2 \neq 0 $$
Third, compute the test-statistic $t^∗$ through
$$t^* = \frac{(\bar{x}_1 - \bar{x}_2) - 0}{s_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}}$$
where $\bar{x}_1$ and $\bar{x}_2$ are the sample mean of 2 groups; $s_1$ and $s_2$ are sample standard deviation of 2 groups, respectively.
$s_p$ is the pooled standard deviation, could be calculated using stat software. $t^*$ follows t-distribution with $df = n_1+n_2-2$.
Third, compute the test-statistic $t^∗$ through
$$t^* = \frac{(\bar{x}_1 - \bar{x}_2) - 0}{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}$$
where $\bar{x}_1$ and $\bar{x}_2$ are the sample mean of 2 groups; $s_1$ and $s_2$ are sample standard deviation of 2 groups, respectively.
Degree of freedom ($df$) could be obtained using stat software.
Fourth step, calculate p-value using statistical software (Stat Crunch, for this course).
Fifth, draw conclusion by comparing the P-value to the significance level α.
Suppose $\bar{x}_1$ and $\bar{x}_2$ are the sample mean of 2 groups; $s_1$ and $s_2$ are sample standard deviation of 2 groups, respectively.
CI for $ \mu_1 - \mu_2$ is given by