Learn R Programming

additivityTests

additivityTests is R package for additivity tests in the two way ANOVA with just one observation per cell.

Introduction

In many applications of statistical methods, it is assumed that the response variable is a sum of several factors and a random noise. In a real world this may not be an appropriate model. For example, some patients may react differently to the same drug treatment or the effect of fertilizer may be influenced by the type of a soil. There might exist an interaction between factors.

If there is more than one observation per cell then standard ANOVA techniques may be applied. Unfortunately, in many cases it is infeasible to get more than one observation taken under the same conditions. For instance, it is not logical to ask the same student the same question twice.

Six tests of additivity hypothesis (under various alternatives) have been included in this package: Tukey test, modified Tukey test, Johnson-Graybill test, LBI test, Mandel test and Tusell test.

Example

Let us generate 10 random subjects, 10 random treatmeants and combine them into a dataset (with no interaction):

    set.seed(123)
    subjects = rnorm(10)
    treatments = rnorm(10)
    noise = rnorm(100)/100
    Y = matrix(rep(subjects,10), 10, 10) + matrix(rep(treatments, each=10), 10, 10) + noise

The tests should not reject the additive hypothesis:

    tukey.test(Y)
    mandel.test(Y)
    lbi.test(Y)
    tusell.test(Y)
    johnson.graybill.test(Y)
    mandel.test(Y)
    mtukey.test(Y, correction=2, Nboot=1000)

Now, the extra effect will be added to the last 5 subjects. The tests should reject the additive hypothesis:

    Y[1:5,] = Y[1:5,] + 10*rep(treatments, each=5)
    
    tukey.test(Y)
    mandel.test(Y)
    lbi.test(Y)
    tusell.test(Y)
    johnson.graybill.test(Y)
    mandel.test(Y)
    mtukey.test(Y, correction=2, Nboot=1000)

Installation

To install the additivityTests from Github, it's easiest to use the devtools package:

    # install.packages("devtools")
    library(devtools)
    install_github("simecek/additivityTests")

Or you can access the stable package version available on [CRAN]

References

Simecek, Petr and Simeckova, Marie. "Modification of Tukey's additivity test." Journal of Statistical Planning and Inference (2012). [ScienceDirect] [arXiv]

Rasch, Dieter, et al. "Tests of additivity in mixed and fixed effect two-way ANOVA models with single sub-class numbers." Statistical Papers 50.4 (2009): 905-916. [Springer]

Copy Link

Version

Install

install.packages('additivityTests')

Monthly Downloads

1,675

Version

1.1-4.2

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

May 14th, 2024

Functions in additivityTests (1.1-4.2)

critical.values

Critical Values for the Johnson-Graybill, LBI and Tusell tests
lbi.test

Locally Best Invariant (LBI) Additivity Test
print.aTest

Print aTest object
tukey.test

Tukey Additivity Test
Boik

Multi-headed Machine Data
mandel.test

Mandel Additivity Test
tusell.test

Tusell Additivity Test
additivityTests-package

Additivity tests in the two way ANOVA with single sub-class numbers.
johnson.graybill.test

Johnson and Graybill Additivity Test
mtukey.test

Modified Tukey Additivity Test