Lecture 5 - Hypothesis Testing (Two sample t-Test) Flashcards
What is the formula for pooled variance?
sp^2 = s1^2 + S2^2 / 2
*essentially you are just taking the average
What do you do when the sample sizes are different?
you calculate sp^2 as a weighted average
*formula on sheet
How do you calculate df for a two sample t test ?
df = (n1 +n2 - 2)
What are the assumptions of a 2 sample t-test ?
1) Random sampling - In order to compare groups, we need to eliminate bias in the selection process
2) Independent samples - All independent t-tests must meet this assumption
3) Sampling from normally distributed populations - The test statistic is somewhat robust to this assumption, particularly where the sample size is large
4) Homogeneity of variance - If there is reason to believe the population variances of the comparison groups are not equal, we need to modify our statistic
State the steps to a 2 sample t test
1) Stat the null hypothesis (H0) - There is no difference in response to the 2 therapies:
H0 = Mu (group 1) = Mu (group 2)
2) Stat the alternative hypothesis: There is a difference in patient response to diuretic therapy alone compared to combination therapy
Ha = Mu (group 1) does not equal Mu (group 2)
3) Set the decision level, alpha: alpha = 0.05
4) Choose the test statistic: 2-sample (pooled variance) t test with df = (n1 + n2 - 2)
* #4 is specific to the diuretic therapy question
Two sample T test:
If the CI doesn’t include zero, then ??
Reject Ho
There is a significant difference
Two sample T test:
If the CI contains zero, then ??
Accept Ho
There is a not a significant difference
Should you use a one or two tailed test for the diuretic or beta blocker combo question ?
You would think that we should do a one tailed test. We are not trying to prove them equal. We are trying to prove that one is better than the other.
You will use a two tailed test because it’s easier to prove it with a one tailed test. When you see a one tailed test you should question it. The conservative thing to do is a two tailed test.
Two tailed test:
Ho = they are the same
Ha = they are not the same
One tailed test:
Ho = diuretic > combo
Ha = diuretic < combo
What is a Type 1 (alpha) error?
Occurs when the null hypothesis is rejected, when in fact it is true; the probability of committing a Type 1 error is usually set at 5%.
By rejecting it we are saying there is a difference. A type 1 error means we got that wrong.
We’re saying there’s a difference but there is no difference.
What is a Type 2 (beta) error?
Occurs when the null hypothesis is not rejected, when in fact, it is false; the probably of committing a Type 2 error is set maximally at 20%.
We are accepting it and saying there is no difference. A type 2 error means we got that wrong.
We’re saying that there’s no difference but there actually is a difference.
Which error is worse ?
Type 1 (We are saying the drug works but it doesn't)
Whereas a type 2 error, you’re saying it doesn’t work but it does (at least in this one, you are not harming anyone)
What is the homogeneity of variance formula ?
0.5 < s1^2 / s2^2 > 2
**So essentially, one can’t be twice as much as the other.
If they are, you must do a separate variance
One sample T test:
If CI contains mean then ?
Accept Ho
One sample T test:
If CI does not contain mean then ?
Reject Ho