Spis treści

Parametric tests

The ANOVA for independent groups

The one-way analysis of variance (ANOVA for independent groups) proposed by Ronald Fisher, is used to verify the hypothesis determining the equality of means of an analysed variable in several ($k\geq2$) populations.

Basic assumptions:

Hypotheses:

\begin{array}{cl}
\mathcal{H}_0: & \mu_1=\mu_2=...=\mu_k,\\
\mathcal{H}_1: & $not all $\mu_j$ are equal $(j=1,2,...,k)$,$
\end{array}

where:

$\mu_1$,$\mu_2$,…,$\mu_k$ – means of an analysed variable of each population.

The test statistic is defined by:

\begin{displaymath}
F=\frac{MS_{BG}}{MS_{WG}},
\end{displaymath}

where:

$\displaystyle MS_{BG} = \frac{SS_{BG}}{df_{BG}}$ – mean square between-groups,

$\displaystyle MS_{WG} = \frac{SS_{WG}}{df_{WG}}$ – mean square within-groups,

$\displaystyle SS_{BG} = \sum_{j=1}^k{\frac{\left(\sum_{i=1}^{n_j}x_{ij}\right)^2}{n_j}}-\frac{\left(\sum_{j=1}^k{\sum_{i=1}^{n_j}x_{ij}}\right)^2}{N}$ – between-groups sum of squares,

$\displaystyle SS_{WG} = SS_{T}-SS_{BG}$ – within-groups sum of squares,

$\displaystyle SS_{T} = \left(\sum_{j=1}^k{\sum_{i=1}^{n_j}x_{ij}^2}\right)-\frac{\left(\sum_{j=1}^k{\sum_{i=1}^{n_j}x_{ij}}\right)^2}{N}$ – total sum of squares,

$df_{BG}=k-1$ – between-groups degrees of freedom,

$df_{WG}=df_{T}-df_{BG}$ – within-groups degrees of freedom,

$df_{T}=N-1$ – total degrees of freedom,

$N=\sum_{j=1}^k n_j$,

$n_j$ – samples sizes for $(j=1,2,...k)$,

$x_{ij}$ – values of a variable taken from a sample for $(i=1,2,...n_j)$, $(j=1,2,...k)$.

The F statistic has the F Snedecor distribution with $df_{BG}$ and $df_{WG}$ degrees of freedom.

The p-value, designated on the basis of the test statistic, is compared with the significance level $\alpha$:

\begin{array}{ccl}
$ if $ p \le \alpha & \Longrightarrow & $ reject $ \mathcal{H}_0 $ and accept $ 	\mathcal{H}_1, \\
$ if $ p > \alpha & \Longrightarrow & $ there is no reason to reject $ \mathcal{H}_0. \\
\end{array}

Effect size - partial $\eta^2$

This quantity indicates the proportion of explained variance to total variance associated with a factor. Thus, in a one-factor ANOVA model for independent groups, it indicates what proportion of the between-groups variability in outcomes can be attributed to the factor under study determining the independent groups.

\begin{displaymath}
\eta^2=\frac{SS_{BG}}{SS_{BG}+SS_{res}}
\end{displaymath}

POST-HOC tests

Introduction to contrast and POST-HOC testing

The settings window with the One-way ANOVA for independent groups can be opened in Statistics menu→Parametric testsANOVA for independent groups or in ''Wizard''.

EXAMPLE(age ANOVA.pqs file)

There are 150 persons chosen randomly from the population of workers of 3 different transport companies. From each company there are 50 persons drawn to the sample. Before the experiment begins, you should check if the average age of the workers of these companies is similar, because the next step of the experiment depends on it. The age of each participant is written in years. Age (company 1): 27, 33, 25, 32, 34, 38, 31, 34, 20, 30, 30, 27, 34, 32, 33, 25, 40, 35, 29, 20, 18, 28, 26, 22, 24, 24, 25, 28, 32, 32, 33, 32, 34, 27, 34, 27, 35, 28, 35, 34, 28, 29, 38, 26, 36, 31, 25, 35, 41, 37\\Age (company 2): 38, 34, 33, 27, 36, 20, 37, 40, 27, 26, 40, 44, 36, 32, 26, 34, 27, 31, 36, 36, 25, 40, 27, 30, 36, 29, 32, 41, 49, 24, 36, 38, 18, 33, 30, 28, 27, 26, 42, 34, 24, 32, 36, 30, 37, 34, 33, 30, 44, 29\\Age (company 3): 34, 36, 31, 37, 45, 39, 36, 34, 39, 27, 35, 33, 36, 28, 38, 25, 29, 26, 45, 28, 27, 32, 33, 30, 39, 40, 36, 33, 28, 32, 36, 39, 32, 39, 37, 35, 44, 34, 21, 42, 40, 32, 30, 23, 32, 34, 27, 39, 37, 35.

Before proceeding with the ANOVA analysis, the normality of the data distribution was confirmed.

The analysis window tested the assumption of equality of variance, obtaining p>0.05 in both tests.

Hypotheses:

$\begin{array}{cl}
\mathcal{H}_0: & $the average age of the workers off all the analysed transport companies is the same,$\\
\mathcal{H}_1: & $at least 2 means are different.$
\end{array}$

Comparing the p-value = 0.005147 of the one-way analysis of variance with the significance level $\alpha=0.05$, you can draw the conclusion that the average ages of workers of these transport companies is not the same. Based just on the ANOVA result, you do not know precisely which groups differ from others in terms of age. To gain such knowledge, it must be used one of the POST-HOC tests, for example the Tukey test. To do this, you should resume the analysis by clicking and then, in the options window for the test, you should select Tukey HSD and Add graph.

The critical difference (CD) calculated for each pair of comparisons is the same (because the groups sizes are equal) and counts to 2.730855. The comparison of the $CD$ value with the value of the mean difference indicates, that there are significant differences only between the mean age of the workers from the first and the third transport company (only if these 2 groups are compared, the $CD$ value is less than the difference of the means). The same conclusion you draw, if you compare the p-value of POST-HOC test with the significance level $\alpha=0.05$. The workers of the first transport company are about 3 years younger (on average) than the workers of the third transport company. Two interlocking homogeneous groups were obtained, which are also marked on the graph.

We can provide a detailed description of the data by selecting Descriptive statistics in the analysis window

2022/02/09 12:56

The contrasts and the POST-HOC tests

An analysis of the variance enables you to get information only if there are any significant differences among populations. It does not inform you which populations are different from each other. To gain some more detailed knowledge about the differences in particular parts of our complex structure, you should use contrasts (if you do the earlier planned and usually only particular comparisons), or the procedures of multiple comparisons POST-HOC tests (when having done the analysis of variance, we look for differences, usually between all the pairs).

The number of all the possible simple comparisons is calculated using the following formula:

\begin{displaymath}
c={k \choose 2}=\frac{k(k-1)}{2}
\end{displaymath}

Hypotheses:

The first example - simple comparisons (comparison of 2 selected means):

\begin{array}{cc}
\mathcal{H}_0: & \mu_1=\mu_2,\\
\mathcal{H}_1: & \mu_1 \neq \mu_2.
\end{array}

The second example - complex comparisons (comparison of combination of selected means):

\begin{array}{cc}
\mathcal{H}_0: & \mu_1=\frac{\mu_2+\mu_3}{2},\\[0.1cm]
\mathcal{H}_1: & \mu_1\neq\frac{\mu_2+\mu_3}{2}.
\end{array}

If you want to define the selected hypothesis you should ascribe the contrast value $c_j$, $(j=1,2,...k)$ to each mean. The $c_j$ values are selected, so that their sums of compared sides are the opposite numbers, and their values of means which are not analysed count to 0.

  • The first example: $c_1=1$, $c_2=-1$, $c_3=0, ...c_k=0$.
  • The second example: $c_1=2$, $c_2=-1$, $c_3=-1$, $c_4=0$,…, $c_k=0$.

How to choose the proper hypothesis:

  • [i] Comparing the differences between the selected means with the critical difference (CD) calculated using the proper POST-HOC test:

\begin{array}{ccl}
$ if the differences between means  $ \ge CD & \Longrightarrow & $ reject $ \mathcal{H}_0 $ and accept $ 	\mathcal{H}_1, \\
$ if the differences between means  $ < CD & \Longrightarrow & $ there is no reason to reject $ \mathcal{H}_0. \\
\end{array}

\begin{array}{ccl}
$ if $ p \le \alpha & \Longrightarrow & $ reject $ \mathcal{H}_0 $ and accept $ 	\mathcal{H}_1, \\
$ if $ p > \alpha & \Longrightarrow & $ there is no reason to reject $ \mathcal{H}_0. \\
\end{array}

The LSD Fisher test

For simple and complex comparisons, equal-size groups as well as unequal-size groups, when the variances are equal.

  • [i] The value of critical difference is calculated by using the following formula:

\begin{displaymath}
CD=\sqrt{F_{\alpha,1,df_{WG}}}\cdot \sqrt{\left(\sum_{j=1}^k \frac{c_j^2}{n_j}\right)MS_{WG}},
\end{displaymath}

where:

$F_{\alpha,1,df_{WG}}$ - is the critical value (statistic) of the F Snedecor distribution for a given significance level$\alpha$ and degrees of freedom, adequately: 1 and $df_{WG}$.

  • [ii] The test statistic is defined by:

\begin{displaymath}
t=\frac{\sum_{j=1}^k c_j\overline{x}_j}{\sqrt{\left(\sum_{j=1}^k \frac{c_j^2}{n_j}\right)MS_{WG}}}.
\end{displaymath}

The test statistic has the t-student distribution with $df_{WG}$ degrees of freedom.

The Scheffe test

For simple comparisons, equal-size groups as well as unequal-size groups, when the variances are equal.

  • [i] The value of a critical difference is calculated by using the following formula:

\begin{displaymath}
CD=\sqrt{F_{\alpha,df_{BG},df_{WG}}}\cdot \sqrt{(k-1)\left(\sum_{j=1}^k \frac{c_j^2}{n_j}\right)MS_{WG}},
\end{displaymath}

where:

$F_{\alpha,df_{BG},df_{WG}}$ - is the critical value(statistic) of the F Snedecor distribution for a given significance level $\alpha$ and $df_{BG}$ and $df_{WG}$ degrees of freedom.

  • [ii] The test statistic is defined by:

\begin{displaymath}
F=\frac{\left(\sum_{j=1}^k c_j\overline{x}_j\right)^2}{(k-1)\left(\sum_{j=1}^k \frac{c_j^2}{n_j}\right)MS_{WG}}.
\end{displaymath}

The test statistic has the F Snedecor distribution with $df_{BG}$ and $df_{WG}$ degrees of freedom.

The Tukey test.

For simple comparisons, equal-size groups as well as unequal-size groups, when the variances are equal.

  • [i] The value of a critical difference is calculated by using the following formula:

\begin{displaymath}
CD=\frac{\sqrt{2}\cdot q_{\alpha,df_{WG},k} \cdot \sqrt{\left(\sum_{j=1}^k \frac{c_j^2}{n_j}\right)MS_{WG}}}{2},
\end{displaymath}

where:

$q_{\alpha,df_{WG},k}$ - is the critical value (statistic) of the studentized range distribution for a given significance level$\alpha$ and $df_{WG}$ and $k$ degrees of freedom.

  • [ii] The test statistic is defined by:

\begin{displaymath}
q=\sqrt{2}\frac{\sum_{j=1}^k c_j\overline{x}_j}{\sqrt{\left(\sum_{j=1}^k \frac{c_j^2}{n_j}\right)MS_{WG}}}.
\end{displaymath}

The test statistic has the studentized range distribution with $df_{WG}$ and $k$ degrees of freedom. Info.

The algorithm for calculating the p-value and the statistic of the studentized range distribution in PQStat is based on the Lund works (1983)1). Other applications or web pages may calculate a little bit different values than PQStat, because they may be based on less precised or more restrictive algorithms (Copenhaver and Holland (1988), Gleason (1999)).

Test for trend.

The test examining the existence of a trend can be calculated in the same situation as ANOVA for independent variables, because it is based on the same assumptions, but it captures the alternative hypothesis differently - indicating in it the existence of a trend in the mean values for successive populations. The analysis of the trend in the arrangement of means is based on contrasts Fisher LSD. By building appropriate contrasts, you can study any type of trend such as linear, quadratic, cubic, etc. Below is a table of sample contrast values for selected trends.

\begin{tabular}{|cc||c|c|c|c|c|c|c|c|c|c|}
\hline
&&\multicolumn{10}{c|}{Contrast}\\\hline
Number of groups&Trends&$c_1$&$c_2$&$c_3$&$c_4$&$c_5$&$c_6$&$c_7$&$c_8$&$c_9$&$c_{10}$\\\hline\hline
\multirow{2}{*}{3}&line&-1&0&1&&&&&&&\\
&quadratic&1&-2&1&&&&&&&\\\hline
\multirow{3}{*}{4}&line&-3&-1&1&3&&&&&&\\
&quadratic&1&-1&-1&1&&&&&&\\
&cubic&-1&3&-3&1&&&&&&\\\hline
\multirow{3}{*}{5}&line&-2&-1&0&1&2&&&&&\\
&quadratic&2&-1&-2&-1&2&&&&&\\
&cubic&-1&2&0&-2&1&&&&&\\\hline
\multirow{3}{*}{6}&line&-5&-3&-1&1&3&5&&&&\\
&quadratic&5&-1&-4&-4&-1&5&&&&\\
&cubic&-5&7&4&-4&-7&5&&&&\\\hline
\multirow{3}{*}{7}&line&-3&-2&-1&0&1&2&3&&&\\
&quadratic&5&0&-3&-4&-3&0&5&&&\\
&cubic&-1&1&1&0&-1&-1&1&&&\\\hline
\multirow{3}{*}{8}&line&-7&-5&-3&-1&1&3&5&7&&\\
&quadratic&7&1&-3&-5&-5&-3&1&7&&\\
&cubic&-7&5&7&3&-3&-7&-5&7&&\\\hline
\multirow{3}{*}{9}&line&-4&-3&-2&-1&0&1&2&3&4&\\
&quadratic&28&7&-8&-17&-20&-17&-8&7&28&\\
&cubic&-14&7&13&9&0&-9&-13&-7&14&\\\hline
\multirow{3}{*}{10}&line&-9&-7&-5&-3&-1&1&3&5&7&9\\
&quadratic&6&2&-1&-3&-4&-4&-3&-1&2&6\\
&cubic&-42&14&35&31&12&-12&-31&-35&-14&42\\\hline
\end{tabular}

Linear trend

A linear trend, like other trends, can be analyzed by entering the appropriate contrast values. However, if the direction of the linear trend is known, simply use the For trend option and indicate the expected order of the populations by assigning them consecutive natural numbers.

The analysis is performed on the basis of linear contrast, i.e. the groups indicated according to the natural order are assigned appropriate contrast values and the statistics are calculated Fisher LSD .

With the expected direction of the trend known, the alternative hypothesis is one-sided and the one-sided $p$-value is interpreted. The interpretation of the two-sided $p$-value means that the researcher does not know (does not assume) the direction of the possible trend.

The p-value, designated on the basis of the test statistic, is compared with the significance level $\alpha$:

\begin{array}{ccl}
$ if $ p \le \alpha & \Longrightarrow & $ reject $ \mathcal{H}_0 $ and accept $ 	\mathcal{H}_1, \\
$ if $ p > \alpha & \Longrightarrow & $ there is no reason to reject $ \mathcal{H}_0. \\
\end{array}

Homogeneous groups.

For each post-hoc test, homogeneous groups are constructed. Each homogeneous group represents a set of groups that are not statistically significantly different from each other. For example, suppose we divided subjects into six groups regarding smoking status: Nonsmokers (NS), Passive smokers (PS), Noninhaling smokers (NI), Light smokers (LS), Moderate smokers (MS), Heavy smokers (HS) and we examine the expiratory parameters for them. In our ANOVA we obtained statistically significant differences in exhalation parameters between the tested groups. In order to indicate which groups differ significantly and which do not, we perform post-hoc tests. As a result, in addition to the table with the results of each pair of comparisons and statistical significance in the form of $p$:

we obtain a division into homogeneous groups:

In this case we obtained 4 homogeneous groups, i.e. A, B, C and D, which indicates the possibility of conducting the study on the basis of a smaller division, i.e. instead of the six groups we studied originally, further analyses can be conducted on the basis of the four homogeneous groups determined here. The order of groups was determined on the basis of weighted averages calculated for particular homogeneous groups in such a way, that letter A was assigned to the group with the lowest weighted average, and further letters of the alphabet to groups with increasingly higher averages.

The settings window with the One-way ANOVA for independent groups can be opened in Statistics menu→Parametric testsANOVA for independent groups or in ''Wizard''.

2022/02/09 12:56

The ANOVA for independent groups with F* and F" corrections

$F^*$ (Brown-Forsythe, 19742)) and $F''$ (Welch, 19513)) Corrections concern ANOVA for independent groups and are calculated when the assumption of equality of variances is not met.

The test statistic is in the form of:

\begin{displaymath}
F^*=\frac{SS_{BG}}{\sum_{j=1}^k\left(1-\frac{n_j}{n}sd_j^2\right)},
\end{displaymath}

\begin{displaymath}
F''=\frac{\frac{\sum_{j=1}^kw_j(\overline{x}_j-\widetilde{x})}{k-1}}{1+\frac{2(k-2)}{k^2-1}\sum_{j=1}^kh_j},
\end{displaymath}

where:

$sd_j$ – group standard deviation $j$,

$w_j=\frac{n_j}{sd_j^2}$ – group weight $j$,

$\widetilde{x}$ – weighted mean,

$h_j=\frac{\left(1-\frac{w_j}{\sum_{j=1}^kw_j}\right)^2}{n_j-1}$.

This statistic is subject toSnedecor's F distribution with $k-1$ and adjusted $df_{WG_k}$ degrees of freedom.

The p-value, designated on the basis of the test statistic, is compared with the significance level $\alpha$:

\begin{array}{ccl}
$ if $ p \le \alpha & \Longrightarrow & $ reject $ \mathcal{H}_0 $ and accept $ 	\mathcal{H}_1, \\
$ if $ p > \alpha & \Longrightarrow & $ there is no reason to reject $ \mathcal{H}_0. \\
\end{array}

POST-HOC Tests

Introduction to the contrasts and POST-HOC tests was done in chapter concerning one-way analysis of variance.

T2 Tamhane test

For simple and complex comparisons, equal-size groups as well as unequal-size groups, when the variances differ significantly (Tamhane A. C., 19774)).

  • [i] The value of critical difference is calculated by using the following formula:

\begin{displaymath}
CD=\sqrt{F_{\alpha_{Sidak},1,df_v}}\cdot \sqrt{\left(\sum_{j=1}^k \frac{c_j^2sd_j^2}{n_j}\right)},
\end{displaymath}

where:

$F_{\alpha_{Sidak},1,df_v}$ - is the critical value (statistics) of the Snedecor's F distribution for modified significance level $\alpha_{Sidak}$ and for degrees of freedom 1 and $df_{v}$ respectively,

$\alpha_{Sidak}=1-(1-\alpha)^{(1/k)}$,

$df_v=\frac{\left(\sum_{j=1}^k\frac{c_j^2sd_j^2}{n_j}\right)^2}{\sum_{j=1}^k\frac{c_j^4sd_j^4}{n_j^2(n_j-1)}}$

  • [ii] The test statistic is in the form of:

\begin{displaymath}
t=\frac{\left(\sum_{j=1}^k c_j\overline{x}_j\right)^2}{\sqrt{\left(\sum_{j=1}^k \frac{c_j^2sd_j^2}{n_j}\right)}}.
\end{displaymath}

This statistic is subject to the t-Student distribution with $df_v$ degrees of freedom, and p-value is adjusted by the number of possible simple comparisons.

BF test (Brown-Forsythe)

For simple and complex comparisons, equal-size groups as well as unequal-size groups, when the variances differ significantly (Brown M. B. i Forsythe A. B. (1974)5)).

  • [i] The value of critical difference is calculated by using the following formula:

\begin{displaymath}
CD=\sqrt{F_{\alpha,k-1,df_v}}\cdot \sqrt{(k-1)\left(\sum_{j=1}^k \frac{c_j^2sd_j^2}{n_j}\right)},
\end{displaymath}

where:

$F_{\alpha,k-1,df_v}$ - is the critical value (statistics) of the Snedecor's F distribution for a given significance level$\alpha$ as well as $k-1$ and $df_v$ degrees of freedom.

  • [ii] The test statistic is in the form of:

\begin{displaymath}
F=\frac{\left(\sum_{j=1}^k c_j\overline{x}_j\right)^2}{(k-1)\left(\sum_{j=1}^k \frac{c_j^2sd_j^2}{n_j}\right)}.
\end{displaymath} This statistic is subject to Snedecor's F distribution with $k-1$ and $df_v$ degrees of freedom.

GH test (Games-Howell).

For simple and complex comparisons, equal-size groups as well as unequal-size groups, when the variances differ significantly (Games P. A. i Howell J. F. 19766)).

  • [i] The value of critical difference is calculated by using the following formula:

\begin{displaymath}
CD=\frac{q_{\alpha,k,df_v} \cdot \sqrt{\left(\sum_{j=1}^k \frac{c_j^2sd_j^2}{n_j}\right)}}{\sqrt{2}},
\end{displaymath}

gdzie:

$q_{\alpha,k,df_v}$ - is the critical value (statistics) of the the distribution of the studentised interval for a given significance level $\alpha$ as well as $k$ and $df_v$ degrees of freedom.

  • [ii] The test statistic is in the form of:

\begin{displaymath}
q=\sqrt{2}\frac{\sum_{j=1}^k c_j\overline{x}_j}{\sqrt{\left(\sum_{j=1}^k \frac{c_j^2sd_j^2}{n_j}\right)}}.
\end{displaymath} This statistic follows a studenty distribution with $k$ and $df_v$ degrees of freedom.

Trend test.

The test examining the presence of a trend can be calculated in the same situation as ANOVA for independent groups with correction $F^*$ and $F''$, because it is based on the same assumptions, however, differently captures the alternative hypothesis - indicating the existence of a trend in the mean values for successive populations. The analysis of the trend of the arrangement of means is based on contrasts (T2 Tamhane). By creating appropriate contrasts you can study any type of trend e.g. linear, quadratic, cubic, etc. A table of sample contrast values for certain trends can be found in the description trend test for Ona-Way ANOVA.

Linear trend

A linear trend, like other trends, can be analyzed by entering the appropriate contrast values. However, if the direction of the linear trend is known, simply use the Linear Trend option and indicate the expected order of the populations by assigning them consecutive natural numbers.

The analysis is performed based on linear contrast, i.e., the groups indicated according to the natural ordering are assigned appropriate contrast values and the T2 Tamhane statistic is calculated.

With the expected direction of the trend being known, the alternative hypothesis is one-sided and the one-sided value of $p$ is subject to interpretation. The interpretation of the two-sided value of $p$ means that the researcher does not know (does not assume) the direction of the possible trend.

The p-value, designated on the basis of the test statistic, is compared with the significance level $\alpha$:

\begin{array}{ccl}
$ if $ p \le \alpha & \Longrightarrow & $ reject $ \mathcal{H}_0 $ and accept $ 	\mathcal{H}_1, \\
$ if $ p > \alpha & \Longrightarrow & $ there is no reason to reject $ \mathcal{H}_0. \\
\end{array}

Settings window for the One-way ANOVA for independent groups with F* and F„ adjustments is opened via menu StatisticsParametric testsANOVA for independent groups or via the ''Wizard''.

EXAMPLE (unemployment.pqs file)

There are many factors that control the time it takes to find a job during an economic crisis. One of the most important may be the level of education. Sample data on education and time (in months) of unemployment are gathered in the file. We want to see if there are differences in average job search time for different education categories.

Hypotheses:

$\begin{array}{cl}
\mathcal{H}_0: & $average job search time is the same $\\
& $for every category of education,$\\
\mathcal{H}_1: & $at least one education category (one population)$\\
& $  have a different average job search time.$\\
\end{array}$

Due to differences in variance between populations (for Levene test $p=0.0001$ and for Brown-Forsythe test $p=0.0002$):

the analysis is performed with the correction of various variances enabled. The obtained result of the adjusted $F$ statistic is shown below.

Comparing $p<0.0001$ (for the $F^*$ test) and $p<0.0001$ (for the $F''$ test) with a significance level of $\alpha=0.05$, we find that the average job search time differs depending on the education one has. By performing one of the POST-HOC tests, designed to compare groups with different variances, we find out which education categories are affected by the differences found:

The least significant difference (LSD) determined for each pair of comparisons is not the same (even though the group sizes are equal) because the variances are not equal. Relating the LSD value to the resulting differences in mean values yields the same result as comparing the p-value with a significance level of $\alpha=0.05$. The differences are between primary and higher education, primary and secondary education, and vocational and higher education. The resulting homogeneous groups overlap. In general, however, looking at the graph, we might expect that the more educated a person is, the less time it takes them to find a job.

In order to test the stated hypothesis, it is necessary to perform the trend analysis. To do so, we {reopen the analysis} with the button and, in the test options window, select: the Tamhane's T2 method, the Contrasts option (and set the appropriate contrast), or the For trend option (and indicate the order of education categories by specifying consecutive natural numbers).

Depending on whether the direction of the correlation between education and job search time is known to us, we use a one-sided or two-sided p-value. Both of these values are less than the given significance level. The trend we predicted is confirmed, that is, at a significance level of $\alpha=0.05$ we can say that this trend does indeed exist in the population from which the sample is drawn.

2022/02/09 12:56

The Brown-Forsythe test and the Levene test

Both tests: the Levene test (Levene, 1960 7)) and the Brown-Forsythe test (Brown and Forsythe, 1974 8)) are used to verify the hypothesis determining the equality of variance of an analysed variable in several ($k>=2$) populations.

Basic assumptions:

Hypotheses:

\begin{array}{cl}
\mathcal{H}_0: & \sigma_1^2=\sigma_2^2=...=\sigma_k^2,\\
\mathcal{H}_1: & $not all $\sigma_j^2$ are equal $(j=1,2,...,k)$,$
\end{array}

where:

$\sigma_1^2$,$\sigma_2^2$,…,$\sigma_k^2$ $-$ variances of an analysed variable of each population.

The analysis is based on calculating the absolute deviation of measurement results from the mean (in the Levene test) or from the median (in the Brown-Forsythe test), in each of the analysed groups. This absolute deviation is the set of data which are under the same procedure performed to the analysis of variance for independent groups. Hence, the test statistic is defined by:

\begin{displaymath}
F=\frac{MS_{BG}}{MS_{WG}},
\end{displaymath}

The test statistic has the F Snedecor distribution with $df_{BG}$ and $df_{WG}$ degrees of freedom. The p-value, designated on the basis of the test statistic, is compared with the significance level $\alpha$:

\begin{array}{ccl}
$ if $ p \le \alpha & \Longrightarrow & $ reject $ \mathcal{H}_0 $ and accept $ 	\mathcal{H}_1, \\
$ if $ p > \alpha & \Longrightarrow & $ there is no reason to reject $ \mathcal{H}_0. \\
\end{array}

Note

The Brown-Forsythe test is less sensitive than the Levene test, in terms of an unfulfilled assumption relating to distribution normality.

The settings window with the Levene, Brown-Forsythe tests' can be opened in Statistics menu→Parametric testsLevene, Brown-Forsythe.

2022/02/09 12:56

The ANOVA for dependent groups

The single-factor repeated-measures analysis of variance (ANOVA for dependent groups) is used when the measurements of an analysed variable are made several times ($k\geq2$) each time in different conditions (but we need to assume that the variances of the differences between all the pairs of measurements are pretty close to each other).

This test is used to verify the hypothesis determining the equality of means of an analysed variable in several ($k\geq2$) populations.

Basic assumptions:

Hypotheses:

\begin{array}{cl}
\mathcal{H}_0: & \mu_1=\mu_2=...=\mu_k,\\
\mathcal{H}_1: & $not all $\mu_j$ are equal $(j=1,2,...,k)$,$
\end{array}

where:

$\mu_1$,$\mu_2$,…,$\mu_k$ – means for an analysed features, in the following measurements from the examined population.

The test statistic is defined by:

\begin{displaymath}
F=\frac{MS_{BC}}{MS_{res}}
\end{displaymath}

where:

$\displaystyle MS_{BC} = \frac{SS_{BC}}{df_{BC}}$ – mean square between-conditions,

$\displaystyle MS_{res} = \frac{SS_{res}}{df_{res}}$ – mean square residual,

$\displaystyle SS_{BC} = \sum_{j=1}^k\left({\frac{\left(\sum_{i=1}^{n}x_{ij}\right)^2}{n}}\right)-\frac{\left(\sum_{j=1}^k{\sum_{i=1}^{n}x_{ij}}\right)^2}{N}$ – between-conditions sum of squares,

$\displaystyle SS_{res} = SS_{T}-SS_{BS}-SS_{BC}$ – residual sum of squares,

$\displaystyle SS_{T} = \left(\sum_{j=1}^k{\sum_{i=1}^{n}x_{ij}^2}\right)-\frac{\left(\sum_{j=1}^k{\sum_{i=1}^{n}x_{ij}}\right)^2}{N}$ – total sum of squares,

$\displaystyle SS_{BS} = \sum_{i=1}^n\left(\frac{\left(\sum_{j=1}^k x_{ij}\right)^2}{k}\right)-\frac{\left(\sum_{j=1}^k{\sum_{i=1}^{n}x_{ij}}\right)^2}{N}$ – between-subjects sum of squares,

$df_{BC}=k-1$ – between-conditions degrees of freedom,

$df_{res}=df_{T}-df_{BC}-df_{BS}$ – residual degrees of freedom,

$df_{T}=N-1$ – total degrees of freedom,

$df_{BS}=n-1$ – between-subjects degrees of freedom,

$N=nk$,

$n$ – sample size,

$x_{ij}$ – values of the variable from $i$ subjects $(i=1,2,...n)$ in $j$ conditions $(j=1,2,...k)$.

The test statistic has the F Snedecor distribution with $df_{BC}$ and $df_{res}$ degrees of freedom.

The p-value, designated on the basis of the test statistic, is compared with the significance level $\alpha$:

\begin{array}{ccl}
$ if $ p \le \alpha & \Longrightarrow & $ reject $ \mathcal{H}_0 $ and accept $ 	\mathcal{H}_1, \\
$ if $ p > \alpha & \Longrightarrow & $ there is no reason to reject $ \mathcal{H}_0. \\
\end{array}

Effect size - partial <latex>$\eta^2$</latex>

This quantity indicates the proportion of explained variance to total variance associated with a factor. Thus, in a repeated measures model, it indicates what proportion of the between-conditions variability in outcomes can be attributed to repeated measurements of the variable.

\begin{displaymath}
\eta^2=\frac{SS_{BC}}{SS_{BC}+SS_{res}}
\end{displaymath}

Testy POST-HOC

Introduction to the contrasts and the POST-HOC tests was performed in the \ref{post_hoc} unit, which relates to the one-way analysis of variance.

The LSD Fisher test

For simple and complex comparisons (frequency in particular measurements is always the same).

Hypotheses:

Example - simple comparisons (comparison of 2 selected means):

\begin{array}{cc}
\mathcal{H}_0: & \mu_j=\mu_{j+1},\\
\mathcal{H}_1: & \mu_j \neq \mu_{j+1}.
\end{array}

  • [i] The value of the critical difference is calculated by using the following formula:

\begin{displaymath}
CD=\sqrt{F_{\alpha,1,df_{res}}}\cdot \sqrt{\left(\sum_{j=1}^k \frac{c_j^2}{n}\right)MS_{res}},
\end{displaymath}

where:

$F_{\alpha,1,df_{res}}$ - is the critical value (statistic) of the F Snedecor distribution for a given significance level $\alpha$and degrees of freedom, adequately: 1 and $df_{res}$.

  • [ii] The test statistic is defined by:

\begin{displaymath}
t=\frac{\sum_{j=1}^k c_j\overline{x}_j}{\sqrt{\left(\sum_{j=1}^k \frac{c_j^2}{n}\right)MS_{res}}}.
\end{displaymath}

The test statistic has the t-Student distribution with $df_{res}$ degrees of freedom. Note!

For contrasts $SE_{contrast}$ is used instead of $\sqrt{\left(\sum_{j=1}^k \frac{c_j^2}{n}\right)MS_{res}}$, and degrees of freedem: $df_{BS}$.

The Scheffe test

For simple comparisons (frequency in particular measurements is always the same).

  • [i] The value of the critical difference is calculated by using the following formula:

\begin{displaymath}
CD=\sqrt{F_{\alpha,df_{BC},df_{res}}}\cdot \sqrt{(k-1)\left(\sum_{j=1}^k \frac{c_j^2}{n}\right)MS_{res}},
\end{displaymath}

where:

$F_{\alpha,df_{BC},df_{res}}$ - is the critical value (statistic) of the F Snedecor distribution for a given significance level $\alpha$ and $df_{BC}$ and $df_{res}$ degrees of freedom.

  • [$\mathfrak{(ii)}$] The test statistic is defined by:

\begin{displaymath}
F=\frac{\left(\sum_{j=1}^k c_j\overline{x}_j\right)^2}{(k-1)\left(\sum_{j=1}^k \frac{c_j^2}{n}\right)MS_{res}}.
\end{displaymath} The test statistic has the F Snedecor distribution with $df_{BC}$ and $df_{ref}$ degrees of freedom.

The Tukey test.

For simple comparisons (frequency in particular measurements is always the same).

  • [i] The value of the critical difference is calculated by using the following formula:

\begin{displaymath}
CD=\frac{\sqrt{2}\cdot q_{\alpha,df_{res},k} \cdot \sqrt{\left(\sum_{j=1}^k \frac{c_j^2}{n}\right)MS_{res}}}{2},
\end{displaymath}

where:

$q_{\alpha,df_{res},k}$ - is the critical value (statistic) of the studentized range distribution for a given significance level $\alpha$ and $df_{res}$ and $k$ degrees of freedom.

  • [ii] The test statistic is defined by:

\begin{displaymath}
q=\sqrt{2}\frac{\sum_{j=1}^k c_j\overline{x}_j}{\sqrt{\left(\sum_{j=1}^k \frac{c_j^2}{n}\right)MS_{res}}}.
\end{displaymath}

The test statistic has the studentized range distribution with $df_{res}$ and $k$ degrees of freedom.

Info.

The algorithm for calculating the p-value and statistic of the studentized range distribution in PQStat is based on the Lund works (1983)\cite{lund}. Other applications or web pages may calculate a little bit different values than PQStat, because they may be based on less precised or more restrictive algorithms (Copenhaver and Holland (1988), Gleason (1999)).

Test for trend.

The test that examines the existence of a trend can be calculated in the same situation as ANOVA for dependent variables, because it is based on the same assumptions, but it captures the alternative hypothesis differently – indicating in it the existence of a trend of mean values in successive measurements. The analysis of the trend in the arrangement of means is based on contrasts Fisher LSD test. By building appropriate contrasts, you can study any type of trend, e.g. linear, quadratic, cubic, etc. A table of example contrast values for selected trends can be found in the description of the testu dla trendu for ANOVA of independent variables.

Linear trend

Trend liniowy, tak jak pozostałe trendy, możemy analizować wpisując odpowiednie wartości kontrastów. Jeśli jednak znany jest kierunek trendu liniowego, wystarczy skorzystać z opcji Trend liniowy i wskazać oczekiwaną kolejność populacji przypisując im kolejne liczby naturalne.

A linear trend, like other trends, can be analyzed by entering the appropriate contrast values. However, if the direction of the linear trend is known, simply use the Fisher LSD test option and indicate the expected order of the populations by assigning them consecutive natural numbers.

With the expected direction of the trend known, the alternative hypothesis is one-sided and the one-sided p-values is interpreted. The interpretation of the two-sided p-value means that the researcher does not know (does not assume) the direction of the possible trend.

The p-value, designated on the basis of the test statistic, is compared with the significance level $\alpha$:

\begin{array}{ccl}
$ if $ p \le \alpha & \Longrightarrow & $ reject $ \mathcal{H}_0 $ and accept $ 	\mathcal{H}_1, \\
$ if $ p > \alpha & \Longrightarrow & $ there is no reason to reject $ \mathcal{H}_0. \\
\end{array}

The settings window with the Single-factor repeated-measures ANOVA can be opened in Statistics menu→Parametric testsANOVA for dependent groups or in ''Wizard''.

EXAMPLE (pressure.pqs file)

2022/02/09 12:56

The ANOVA for dependent groups with Epsilon correction and MANOVA

Epsilon and MANOVA corrections apply to repeated measurements ANOVA and are calculated when the assumption of sphericity is not met or the variances of the differences between all pairs of measurements are not close to each other.

Correction of non-sphericity

The degree to which sphericity is met is represented by the value of $W$ in the Mauchly test, but also by the values of Epsilon ($\varepsilon$) calculated with corrections. $\varepsilon=1$ indicates strict adherence to the sphericity condition. The smaller the value of Epsilon is compared to 1, the more the sphericity assumption is affected. The lower limit that Epsilon can reach is $\frac{1}{k-1}$.

To minimize the effects of non-sphericity, three corrections can be used to change the number of degrees of freedom when testing from an F distribution. The simplest but weakest is the Epsilon lower bound correction. A slightly stronger but also conservative one is the Greenhouse-Geisser correction (1959)9). The strongest is the correction by Huynh-Feldt (1976)10). When sphericity is significantly affected, however, it is most appropriate to perform an analysis that does not require this assumption, namely MANOVA.

A multidimensional approach - MANOVA

MANOVA i.e. multivariate analysis of variance not assuming sphericity. If this assumption is not met, it is the most efficient method, so it should be chosen as a substitute for analysis of variance for repeated measurements. For a description of this method, see univariate MANOVA. Its use for repeated measures (without the independent groups factor) limits its application to data that are differences of adjacent measurements and provides testing of the same hypothesis as ANOVA for dependent variables. Settings window for ANOVA for dependent groups with Epsilon correction and MANOVA is opened via menu StatisticsParametric testsANOVA for dependent groups or via ''Wizard''.

EXAMPLE (pressure.pqs file)

The effectiveness of two treatments for hypertension was analyzed. A sample of 56 patients was collected and randomly assigned to two groups: group treated with drug A and group treated with drug B. Systolic blood pressure was measured three times in each group: before treatment, during treatment and after 6 months of treatment.

Hypotheses for treated with drug A:

$\begin{array}{cl}
\mathcal{H}_0: & $Mean systolic blood pressure is the same$\\
& $at any stage of treatment - for those treated with drug A,$\\
\mathcal{H}_1: & $At least one stage of treatment with the drug A$\\
& $  mean systolic blood pressure is different.$\\
\end{array}$

The hypotheses for those treated with drug B read similar.

Since the data have a normal distribution, we begin our analysis by testing the assumption of sphericity. We perform the testing for each group separately using a multiple filter.

Failure to meet the sphericity assumption by the group treated with drug B is indicated by both the observed values of the covariance and correlation matrix and the result of the Mauchly test ($W=0.68$, p=0.0063.

We resume our analysis and in the test options window select the primary filter to perform a repeated-measures ANOVA - for those treated with drug A, followed by a correction of this analysis and a MANOVA statistic - for those treated with drug B.

Results for those treated with drug A:

indicate significant (at the level of significance $\alpha=0.05$) differences between mean systolic blood pressure values (p<0.0001 for repeated measures ANOVA). More than 66% of the between-conditions variation in outcomes can be explained by the use of drug A ($\eta=0.66$). The differences apply to all treatment stages compared (POST-HOC score). The decrease in systolic blood pressure due to treatment is also significant (p<0.0001). Thus, we can consider Drug A as an effective drug.

Results for those treated with drug B:

indicate that there are no significant differences between mean systolic blood pressure values, both when we use epsilon and Lambda Wilks (MANOVA) corrections. As little as 17% of the between-conditions variation in results can be explained by the use of drug B ($\eta=0.17$).

2022/02/09 12:56

Mauchly's sphericity

Sphericity assumption is similar but stronger than the assumption of equality of variance. It is met if the variances for the differences between pairs of repeated measurements are the same. Usually, the simpler but more stringent compound symmetry condition is considered in place of the sphericity assumption. This can be done because meeting the compounded symmetry condition entails meeting the sphericity assumption.

Compound symmetry condition assumes, symmetry in the covariance matrix, and therefore equality of variances (elements of the main diagonal of the covariance matrix) and equality of covariances (elements off the main diagonal of the covariance matrix).

Violating the assumption of sphericity or combined symmetry unduly reduces the conservatism of the F-test (makes it easier to reject the null hypothesis).

To check the sphericity assumption, the Mauchly test is used (1940)\cite{mauchly}. Statistical significance ($p\le \alpha$) here implies a violation of the sphericity assumption.

Basic application conditions:

Hypotheses:

\begin{array}{cl}
\mathcal{H}_0: & \sigma_{diff(1)}=\sigma_{diff(2)}=...=\sigma_{diff(s)},\\
\mathcal{H}_1: & $not all $\sigma_{diff(i)}$ are equal $(i=1,2,...,s)$,$
\end{array}

where:

$\sigma_{diff(i)}$ - population variance of differences between $i$-th pair of repeated measurements,

$s$ - number of pairs.

Mauchly's $W$ value is defined as follows:

\begin{displaymath}
W=\frac{\prod_{j=1}^{k-1}\lambda_j}{\left(\frac{1}{k-1}\sum_{j=1}^{k-1}\lambda_j\right)^{k-1}}.
\end{displaymath}

The test statistic has the form of:

\begin{displaymath}
\chi^2=(f-1)(n-1)\ln W,
\end{displaymath}

where:

$f=\frac{2(k-1)^2+(k-1)+2}{6(k-1)(n-1)}$,

$\lambda_j$ - eigenvalue of the expected covariance matrix,

$k$ - number of variables analyzed.

This statistic has asymptotically (for large sample) Chi-square distribution with $df=\frac{k(k-1)}{2}-1$ degrees of freedom.

The p-value, designated on the basis of the test statistic, is compared with the significance level $\alpha$:

\begin{array}{ccl}
$ if $ p \le \alpha & \Longrightarrow & $ reject $ \mathcal{H}_0 $ and accept $ 	\mathcal{H}_1, \\
$ if $ p > \alpha & \Longrightarrow & $ there is no reason to reject $ \mathcal{H}_0. \\
\end{array}

A value of $W\approx1$ is an indication that the sphericity assumption is met. In interpreting the results of this test, however, it is important to note that it is sensitive to violations of the normality assumption of the distribution.

EXAMPLE (pressure.pqs file)

2022/02/09 12:56
1)
Lund R.E., Lund J.R. (1983), Algorithm AS 190, Probabilities and Upper Quantiles for the Studentized Range. Applied Statistics; 34
2)
Brown M. B., Forsythe A. B. (1974), The small sample behavior of some statistics which test the equality of several means. Technometrics, 16, 385-389
3)
Welch B. L. (1951), On the comparison of several mean values: an alternative approach. Biometrika 38: 330–336
4)
Tamhane A. C. (1977), Multiple comparisons in model I One-Way ANOVA with unequal variances. Communications in Statistics, A6 (1), 15-32
5)
Brown M. B., Forsythe A. B. (1974), The ANOVA and multiple comparisons for data with heterogeneous variances. Biometrics, 30, 719-724
6)
Games P. A., Howell J. F. (1976), Pairwise multiple comparison procedures with unequal n's and/or variances: A Monte Carlo study. Journal of Educational Statistics, 1, 113-125
7)
Levene H. (1960), Robust tests for the equality of variance. In I. Olkin (Ed.) Contributions to probability and statistics (278-292). Palo Alto, CA: Stanford University Press
8)
Brown M.B., Forsythe A. B. (1974a), Robust tests for equality of variances. Journal of the American Statistical Association, 69,364-367
9)
Greenhouse S. W., Geisser S. (1959), On methods in the analysis of profile data. Psychometrika, 24, 95–112
10)
Huynh H., Feldt L. S. (1976), Estimation of the Box correction for degrees of freedom from sample data in randomized block and split=plot designs. Journal of Educational Statistics, 1, 69–82