Line 45: |
Line 45: |
| ==Comparing a quantitative variable between two groups== | | ==Comparing a quantitative variable between two groups== |
| ===t-test=== | | ===t-test=== |
− | The t-test (also known as the 'Student's t-test') is the most commonly used test for the comparison of two normally distributed variables, and can also be used to assess whether a single normally distributed variable differs from a particular value. As for many hypothesis tests, it involves the calculation of a test statistic which is assumed to follow a particular distribution (in this case, the t distribution). When calculating the test statistic for the comparison of two distributions with approximately equal variances and equal numbers of individuals in each group, the difference in mean values between the two groups is divided by the standard error of the difference between these two means (which is calculated as the product of the pooled standard deviation and the square root of two divided by the number of individuals in each group). | + | The t-test (also known as the 'Student's t-test') is the most commonly used test for the comparison of two normally distributed variables, and can also be used to assess whether a single normally distributed variable differs from a particular value. As for many hypothesis tests, it involves the calculation of a test statistic which is assumed to follow a particular distribution (in this case, the t distribution). The general approach to the calculation of the test statistic is to divide the difference of interest (whether that is the difference between the mean of interest and a particular value, or the difference between two different means of interest) with the standard error of this difference. The methods of calculation of the standard error therefore differ depending upon the characteristics of the data in question: |
| + | * When comparing the mean of a group with a particular value, the difference between the mean and the value in question is divided by the product of the standard deviation of the group and the the reciprocal of the square root of the number of individuals in the sample. |
| + | * When comparing the means of two group, the approach used depends on other characteristics of the data: |
| + | ** when both groups have approximately equal variances and there are equal numbers of individuals in each group, the difference in mean values between the two groups is divided by the product of the pooled standard deviation and the square root of two divided by the number of individuals in each group. |
| + | ** when both groups have approximately equal variances but there are different numbers of individuals in each group, the difference in mean values between the two groups is divided by the product of the pooled standard deviation and the square root of the sum of the reciprocals of the group sizes. |
| + | ** when the groups have different variances, the difference in mean values between the two groups is divided by the square root of the sum of the variances of each group divided by the group size |
| | | |
| ===Mann-Whitney U test=== | | ===Mann-Whitney U test=== |