# Part 9: t-tests and nonparametric tests

### Paired t-test (compare two data means)

A paired t-test is used to compare means of two data groups and where observations in one group can be paired with observations in the other group. We can apply the paired t-tests in before-and-after observations at the same object (blood pressure before and after treatment with a drug) or comparison of two methods (or treatments) to the sample subject. The data should be normally distributed and have approximately equal variances. If we want to compare the means of more than two data group, we have to perform 1-way ANOVA. We can not perform multiple t-tests.

The null hypothesis is

H0: there is no difference between in means of the two data group.

The alternative hypothesis is

H1: the two data groups have different means (effects), on average.

### Unpaired t-test (compare two data means)

Similar to the paired t-test, an unpaired t-test is used to compare two population means where observations can not be paired. We apply the unpaired test to compare observations made on different subjects, for example difference in the average heart rate between female and male athletics. The null and alternative hypotheses are the same as for the paired test. The data should be normally distributed and have approximately equal variances. If we want to compare the means of more than two data group, we have to perform 1-way ANOVA. We can not perform multiple t-tests.

### One-sample t-test (compare data mean with value)

The one-sample t-test compares the mean of a single data group with a specified value. We apply this test to compare observations to a reference or standard value. For example, we can compare the weight loss of a group of patients after completing a new diet program. In this case we choose zero as a reference value, and the null hypothesis H0 is that there is no difference between the average weight loss and zero, that mean the diet program is not effective. Alternatively, H1 is that the weight loss is significant different to zero, and we can conclude that the program is effective. The observation should follow a normal distribution.

### One-sample Z test

The one-sample Z test compares a sample (or proportion) to a defined population. When we say „defined“ population, we are saying that the parameters of the population are known. We typically define a population distribution in terms of central tendency and variability/dispersion. Thus, for the one-sample Z test, the population mean m and standard deviation s must be known. Population information is available in the technical manuals of measurement instruments or in research publications. For instance, we are doing research on data collected from successive cohorts of students taking the Elementary Statistics class. We may want to know if this particular sample of college students is similar to or different from college students in general.

### Two-Sample F test (compare two variances)

We might ask if the variances of two data groups are equal. The null hypothesis is H0: s12=s22, and the alternative hypothesis is H1: s12?s22. The F statistic is the ratio of F=s12/s22 or F=s22/s12, whichever is larger. The F statistic is compared to a critical value depending on the sample size and significance level, and the null hypothesis is not reject with the F statistic is smaller than the critical value.

### One-sample Chi square test (compare variance with value)

The chi square test is a one sample test to determine the equality of the variances between a single data group and a user-defined value. The null and alternative hypotheses are the same as for the F test.

### One sample Wilcoxon Signed Rank (compare data median with value)

The Wilcoxon signed rank test is an example of a nonparametric or distribution free test. The Wilcoxon signed rank sum test is used to test the null hypothesis that the median of a data group is equal to some value. We can use it in place of a one-sample t-test or for ordered categorical data where a numerical scale is inappropriate but where it is possible to rank the observations.

### Paired Wilcoxon Signed Rank (compare two data medians)

The paired Wilcoxon signed rank test is an another example of a nonparametric test. The paired Wilcoxon signed rank sum test is a two-sample test and used to test the null hypothesis that the median of two data groups are equal. We can use it in place of a paired t-test, but we need to remember that nonparametric tests are less powerful (click here to learn more).

### Mann-Whitney (compare two data means)

The Mann-Whitney test is a nonparametric test that can be used in place of an unpaired t-test. We can use it to test the null hypothesis that two data groups come from the same population (i.e. have the same median) or, alternatively, whether observations in one sample tend to be larger than observations in the other. Although it is a nonparametric test it does assume that the two distributions are similar in shape.

### McNemar’s test (compare dichotomous data)

The McNemar test is a test on square table when we want to test the difference between paired count data (i.e. proportions), e.g. in studies in which patients serve as their own control, or in studies with „before and after“ design. Dichotomous data are nominal-scaled data which can have two possible values, for example observations recorded as male or female, postive or negative, yes or no, present or absent etc.

For example, we want to test the effectiveness of two lotions to relief the symptoms of skin rashes. We apply the two lotions to 80 patients with a skin rashes on both arms. We count the patients experience a relief and no relief.

 Lotion A Lotion B Relief No relief Relief 25 15 No relief 5 35

Werbeanzeigen