8992
Comment:
|
← Revision 41 as of 2012-01-23 18:14:22 ⇥
8986
|
Deletions are marked like this. | Additions are marked like this. |
Line 4: | Line 4: |
* [[#z-test|z-test]] | * [[#z-test|Z-test]] * [[#z-test-example|Example Problem]] * [[#z-test-solution|Solve the Problem by Hand]] |
Line 6: | Line 8: |
* [[#t-test|single-sample t-test]] * [[#t-test-example|example problem]] * [[#t-test-sample-sd|calculate sample standard deviation]] * [[#t-test-solution|solve the problem by hand]] |
* [[#t-test|Single-Sample t-test]] * [[#t-test-example|Example Problem]] * [[#t-test-sample-sd|Calculate Sample Standard Deviation]] * [[#t-test-solution|Solve the Problem by Hand]] |
Line 11: | Line 13: |
* [[#sign-test|sign test: when the experimental results are binary outcomes]] . In this section, we are going to review these tests by working through a few toy problems. |
In this section, we are going to review these tests by working through a few toy problems. |
Line 19: | Line 20: |
Note that conducting a z-test requires that information other than the variable of interest is available. For instance, the standard deviation of the neuronal density in the '''target population''' (not the sample!) must be known -- or at least can be estimated with reasonably high accuracy (i.e. if the sample size of your experiment is on the order of thousands). If, however, the sample size of your experiment is small and no information regarding the standard deviation of the population is available, the [[#t-test|t-test]] is recommended. | Note that conducting a z-test requires that information other than the variable of interest is available. For instance, the standard deviation of the neuronal density in the '''target population''' (not the sample!) must be known -- or at least can be estimated with reasonably high accuracy (i.e. if the sample size of your experiment is on the order of thousands). If, however, the sample size of your experiment is small and no information regarding the standard deviation of the population is available, the [[#t-test|single-sample t-test]] is recommended. <<Anchor(z-test-example)>> |
Line 23: | Line 26: |
In order to test the effectiveness of a human growth drug, you administer the drug to 16 boys, aged 14. Six years later, you measure their heights and find an average height for your subjects of 71 inches. You know that the average height of American males is 70 inches and the standard deviation is 9 inches. | In order to test the effectiveness of a human growth drug, you administer the drug to 16 boys American, aged 14. Six years later, you measure their heights and find an average height for your subjects of 71 inches. You know that the average height of American males is 70 inches and the standard deviation is 9 inches. |
Line 28: | Line 31: |
. <<latex($H_{0}$)>>: Teenage boys who take the human growth drug will not grow faster or slower than average American males. | . ''H,,0,,'': Human growth drug (administered at ages 14-20) has no effect on the height of American males. |
Line 30: | Line 33: |
In mathematical terms, the null hypothesis is that <<latex($\mu=\mu_{0}$)>>, where <<latex($\mu$)>> stands for the population mean of teenage boys who take the human growth drug, and <<latex($\mu_{0}$)>> the population mean of American males. | In mathematical terms, the null hypothesis is that {{attachment:mu.gif|mu}} = {{attachment:mu.gif|mu}}'',,0,,'', where {{attachment:mu.gif|mu}} stands for the population mean height of males who take the growth drug during their teen years, and {{attachment:mu.gif|mu}}'',,0,,'' the population mean height of American males. |
Line 32: | Line 35: |
We will assume that the <<latex($\alpha$)>> level is set to 0.05 and the test is two-tailed. | We will assume that the ''z,,obt,,'' {{attachment:alpha.gif|alpha}} level is set to 0.05 and the test is two-tailed. <<Anchor(z-test-solution)>> |
Line 36: | Line 41: |
To determine whether or not we should reject the null hypothesis, we need to calculate the z statistic <<latex($\z_{obt}$)>> and then determine its significance. The formula for calculating <<latex($\z_{obt}$)>> is: | To determine whether or not we should reject the null hypothesis, we need to calculate the z statistic ''z,,obt,,'' and then determine its significance. The formula for calculating ''z,,obt,,'' is: |
Line 44: | Line 49: |
where <<latex($\overline{X}_{obt}$)>> is the sample mean, <<latex($\mu_0$)>> the population mean of American males, <<latex($\sigma$)>> the population standard deviation, and N the sample size. Plugging in the numbers, it is easy to get: | where {{attachment:xbar.gif|X-bar}}'',,obt,,'' is the sample mean, {{attachment:mu.gif|mu}}'',,0,,'' the population mean of American males, <<latex($\sigma$)>> the population standard deviation, and ''N'' the number of observations (sample size). Plugging in the numbers, it is easy to get: |
Line 52: | Line 57: |
Finally, we need to determine whether the effect is significant based on the calculated <<latex($z_{obt}$)>>. One can look up in the z table (usually the first Appendix table in a stats textbook) and find out the critical value for <<latex($\alpha = 0.05$)>> and a two-tailed test is 1.96. The critical z score is clearly larger than the calculated <<latex($z_{obt}$)>>; therefore, we retain the null hypothesis. | Finally, we need to determine whether the effect is significant based on the calculated ''z,,obt,,''. One can look up in the z table (usually the first Appendix table in a stats textbook) and find out the critical value for {{attachment:alpha.gif|alpha}} = 0.05 and a two-tailed test is 1.96. The critical z score is clearly larger than the calculated ''z,,obt,,''; therefore, we retain the null hypothesis. |
Line 58: | Line 63: |
== Single-sample t-test == The single-sample t-test is often more commonly used as we as experimenters rarely know the true standard deviation of the target population. The only available information has to come from the sample data collected in the experiment. For example, Smokin' Joe wants to know whether marijuana can increase appetite and conducted an experiment: |
== Single-Sample t-test == The single-sample t-test is more often used since we, as experimenters, rarely know the true standard deviation of the target population. The only available information has to come from the sample data collected in the experiment. For example, Smokin' Joe wants to know whether marijuana can increase appetite and conducted an experiment: |
Line 68: | Line 73: |
In other words, Smokin' Joe wants to test whether the difference in calories eaten by AIDS patients (i.e. the property of a group) is different from 0 (i.e. a hypothetical value). If it is significantly different from 0, we can reject the null hypothesis which states that marijuana has no effect on appetite. | In other words, Smokin' Joe wants to test whether the difference in calories eaten by AIDS patients (i.e. the property of a group) is different from 0 (i.e. a hypothetical value). If it is significantly different from 0, we can reject the null hypothesis which states that marijuana has no effect on appetite. Formally, the null hypothesis is: . ''H,,0,,'': THC has no effect on appetite in AIDS patients, or {{attachment:mu.gif|mu}} = 0, where {{attachment:mu.gif|mu}} is the population mean of the difference in the number of calories eaten by patients before and after taking the THC pill. |
Line 75: | Line 82: |
One possible solution to the problem, which allows us to use the single-sample t-test, is to approximate the population standard deviation <<latex($\sigma$)>> with sample standard deviation <<latex($s$)>>. Recall that the equation to calculate the z statistic <<latex($z_{obt}$)>> is: | One possible solution to the problem, which allows us to use the single-sample t-test, is to approximate the population standard deviation <<latex($\sigma$)>> with sample standard deviation ''s''. Recall that the equation to calculate the z statistic ''z,,obt,,'' is: |
Line 79: | Line 86: |
z_{obt} = \frac{\overline{X}_{obt} - \mu}{\sigma / \sqrt{N}} | z_{obt} = \frac{\overline{X}_{obt} - \mu_0}{\sigma / \sqrt{N}} |
Line 82: | Line 89: |
In the single sample <<latex($t$)>> test, we simply replace <<latex($\sigma$)>> with the standard deviation of the sample <<latex($s$)>> to get <<latex($t_{obt}$)>>: | In the single-sample t-test, we simply replace <<latex($\sigma$)>> with the standard deviation of the sample ''s'' to get ''t,,obt,,'': |
Line 86: | Line 93: |
t_{obt} = \frac{\overline{X}_{obt} - \mu}{s / \sqrt{N}} | t_{obt} = \frac{\overline{X}_{obt} - \mu_0}{s / \sqrt{N}} |
Line 89: | Line 96: |
Once we have calculated <<latex($t_{obt}$)>>, we need to determine the significance of the statistic. If you are working with a stats program, the significance <<latex($p$)>> value, including the <<latex($t_{obt}$)>>, is calculated automatically for you. If you are working with pen and paper, you will need to look up in the t distribution table (usually in the appendix of any statistics textbook) for the corresponding <<latex($t_{crit}$)>> value. In looking for the correct critical value to compare with, we also need to determine the [[DegreesOfFreedom|degrees of freedom]] (DF) of the current test. For any single-sample t test, the DF is <<latex($N-1$)>>, where ''N'' is the sample size. It is then easy to locate the critical value in the table by choosing the right test (one-tailed or two-tailed?), the <<latex($\alpha$)>> level, and the DF. | Once we have calculated ''t,,obt,,'', we need to determine the significance of the statistic. If you are working with a stats program, the significance ''p'' value, including the ''t,,obt,,'', is calculated automatically for you. If you are working with pen and paper, you will need to look up in the t distribution table (usually in the appendix of any statistics textbook) for the corresponding ''t,,crit,,'' value. In looking for the correct critical value to compare with, we also need to determine the degrees of freedom (''df'') of the current test. For any single-sample t-test, the ''df'' is ''N-1'', where ''N'' is the sample size. It is then easy to locate the critical value in the table by choosing the right test (one-tailed or two-tailed?), {{attachment:alpha.gif|alpha}} level, and the ''df''. |
Line 93: | Line 100: |
=== Solve the Example Problem By Hand === Now we proceed to solve the example problem. Let's do a two-tailed test (see GeneralGuidance for topics on how to choose between a two-tailed test and a one-tailed test) with <<latex($\alpha$)>> value set to 0.05. To calculate the <<latex($t_{obt}$)>>, we calculate the following items first: |
=== Solve the Problem by Hand === Now we proceed to solve the example problem. Let's do a two-tailed test with {{attachment:alpha.gif|alpha}} value set to 0.05. To calculate the ''t,,obt,,'', we calculate the following items first: |
Line 96: | Line 103: |
* The sample average difference score <<latex($\overline{X}_{obt} = 91.5$)>> * The population average difference score <<latex($\mu = 0$)>> (by definition; since we want to know whether there '''is''' a change) * The sample standard deviation <<latex($s = 117.449$)>> |
* The sample average difference score {{attachment:xbar.gif|X-bar}}'',,obt,,'' = ''91.5''. * The population average difference score specified by the null hypothesis {{attachment:mu.gif|mu}}'',,0,,'' = 0 ({{attachment:mu.gif|mu}}'',,0,,'' = 0 is the null hypothesis that states there is no difference in calories eaten). * The sample standard deviation ''s = 117.449''. |
Line 102: | Line 109: |
Now we plug these numbers in the above equation: | Now we plug these numbers into the above equation: |
Line 106: | Line 113: |
t_{obt} = \frac{\overline{X}_{obt} - \mu}{s / \sqrt{N}} = \frac{91.5-0}{117.449 / 3.162} = 2.463 | t_{obt} = \frac{\overline{X}_{obt} - \mu_0}{s / \sqrt{N}} = \frac{91.5-0}{117.449 / 3.162} = 2.463 |
Line 109: | Line 116: |
Looking up in the critical values table for the t distribution, we find that <<latex($t_{crit} = 2.262$)>> given that DF is 9 and <<latex($\alpha$)>> is 0.05 for a two-tailed test. Since our t statistic is greater than the critical value, we reject the null hypothesis. We conclude that Smokin' Joe's experimental results do not support the hypothesis that marijuana does not increase appetite. | Looking up in the critical values table for the t distribution, we find that ''t,,crit,, = 2.262'' given that ''df'' is 9 and {{attachment:alpha.gif|alpha}} is 0.05 for a two-tailed test. Since our t statistic is greater than the critical value, we reject the null hypothesis. We conclude that Smokin' Joe's experimental results support the hypothesis that taking the THC pill increases appetite. |
Line 111: | Line 118: |
It is extremely important to keep in mind that '''we cannot conclude that the experiments results support the alternative hypothesis, which states marijuana does increase appetite'''. The rejection of the null hypothesis, in frequentist statistics (which t-test belongs to), does not mean that the alternative hypothesis is TRUE. <<Anchor(sign-test)>> == Sign test (using binomial distribution) == The sign test is based on the binomial distribution |
[[FrontPage|Go back to the Homepage]] |
Statistical Tests for Experiments with Single Samples
Sometimes, the research question is as simple as investigating whether the value of a certain property of a group differs from a hypothetical value (specified by the null hypothesis). Depending on what information is available, one can choose between the following types of tests:
In this section, we are going to review these tests by working through a few toy problems.
Z-test
The z-test is often used to compare a set of experimental measurements to a given constant as specified by the null hypothesis. For example, suppose that we know the mean and standard deviation of neuronal density of the frontal cortex, our research interest is to investigate whether Einstein's neuronal density is significantly different from the average -- the test statistic under the null hypothesis. The z-test is appropriate in such contexts.
Note that conducting a z-test requires that information other than the variable of interest is available. For instance, the standard deviation of the neuronal density in the target population (not the sample!) must be known -- or at least can be estimated with reasonably high accuracy (i.e. if the sample size of your experiment is on the order of thousands). If, however, the sample size of your experiment is small and no information regarding the standard deviation of the population is available, the single-sample t-test is recommended.
Example Problem
In order to test the effectiveness of a human growth drug, you administer the drug to 16 boys American, aged 14. Six years later, you measure their heights and find an average height for your subjects of 71 inches. You know that the average height of American males is 70 inches and the standard deviation is 9 inches.
The first step is always to identify the null hypothesis. In this case, the null hypothesis can be:
H0: Human growth drug (administered at ages 14-20) has no effect on the height of American males.
In mathematical terms, the null hypothesis is that = 0, where stands for the population mean height of males who take the growth drug during their teen years, and 0 the population mean height of American males.
We will assume that the zobt level is set to 0.05 and the test is two-tailed.
Solve the Problem by Hand
To determine whether or not we should reject the null hypothesis, we need to calculate the z statistic zobt and then determine its significance. The formula for calculating zobt is:
where obt is the sample mean, 0 the population mean of American males, the population standard deviation, and N the number of observations (sample size). Plugging in the numbers, it is easy to get:
Finally, we need to determine whether the effect is significant based on the calculated zobt. One can look up in the z table (usually the first Appendix table in a stats textbook) and find out the critical value for = 0.05 and a two-tailed test is 1.96. The critical z score is clearly larger than the calculated zobt; therefore, we retain the null hypothesis.
Conclusion: from the current experiment, there is not enough evidence to show that the growth drug is effective. (Be careful not to conclude that the null hypothesis is TRUE. Failure to reject to the null hypothesis does not mean the null hypothesis is correct.)
Single-Sample t-test
The single-sample t-test is more often used since we, as experimenters, rarely know the true standard deviation of the target population. The only available information has to come from the sample data collected in the experiment. For example, Smokin' Joe wants to know whether marijuana can increase appetite and conducted an experiment:
Example Problem
Smokin’ Joe hypothesizes that marijuana can be used to mitigate some of the negative side effects of common AIDS drugs, such as loss of appetite. He wants to test the hypothesis that marijuana increases the appetites of AIDS patients who are taking common AIDS drugs. He measures the difference in calories eaten by patients the day after taking a THC pill and the day before taking the pill. Here are the measurements he obtains for 10 subjects – [101, 75, -82, 32, -50, 203, 165, 145, 303, 23]
In other words, Smokin' Joe wants to test whether the difference in calories eaten by AIDS patients (i.e. the property of a group) is different from 0 (i.e. a hypothetical value). If it is significantly different from 0, we can reject the null hypothesis which states that marijuana has no effect on appetite. Formally, the null hypothesis is:
H0: THC has no effect on appetite in AIDS patients, or = 0, where is the population mean of the difference in the number of calories eaten by patients before and after taking the THC pill.
Note here the only information available is the difference scores of the 10 subjects. We do not know the true standard deviation of the population of difference scores. Therefore, a z-test is not applicable in this case.
Approximate Population SD with Sample SD
One possible solution to the problem, which allows us to use the single-sample t-test, is to approximate the population standard deviation with sample standard deviation s. Recall that the equation to calculate the z statistic zobt is:
In the single-sample t-test, we simply replace with the standard deviation of the sample s to get tobt:
Once we have calculated tobt, we need to determine the significance of the statistic. If you are working with a stats program, the significance p value, including the tobt, is calculated automatically for you. If you are working with pen and paper, you will need to look up in the t distribution table (usually in the appendix of any statistics textbook) for the corresponding tcrit value. In looking for the correct critical value to compare with, we also need to determine the degrees of freedom (df) of the current test. For any single-sample t-test, the df is N-1, where N is the sample size. It is then easy to locate the critical value in the table by choosing the right test (one-tailed or two-tailed?), level, and the df.
Solve the Problem by Hand
Now we proceed to solve the example problem. Let's do a two-tailed test with value set to 0.05. To calculate the tobt, we calculate the following items first:
The sample average difference score obt = 91.5.
The population average difference score specified by the null hypothesis 0 = 0 (0 = 0 is the null hypothesis that states there is no difference in calories eaten).
The sample standard deviation s = 117.449.
Note: always carry at least three decimal places if working by hand. Rounding excessively in intermediate steps can lead to very very very inaccurate results.
Now we plug these numbers into the above equation:
Looking up in the critical values table for the t distribution, we find that tcrit = 2.262 given that df is 9 and is 0.05 for a two-tailed test. Since our t statistic is greater than the critical value, we reject the null hypothesis. We conclude that Smokin' Joe's experimental results support the hypothesis that taking the THC pill increases appetite.