Package 'additivityTests'

Title: Additivity Tests in the Two Way Anova with Single Sub-class Numbers
Description: Implementation of the Tukey, Mandel, Johnson-Graybill, LBI, Tusell and modified Tukey non-additivity tests.
Authors: Marie Simeckova [aut], Thomas Rusch [aut], Petr Simecek [cre]
Maintainer: Petr Simecek <[email protected]>
License: GPL-3
Version: 1.1-4
Built: 2024-08-25 03:24:40 UTC
Source: https://github.com/simecek/additivitytests

Help Index


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

Description

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) are included in this package: Tukey test, modified Tukey test, Johnson-Graybill test, LBI test, Mandel test and Tussel test.

Details

Testing for interaction in the two way ANOVA with single sub-class numbers.

Author(s)

Petr Simecek <[email protected]>


Multi-headed Machine Data

Description

Performance of a multiple-headed machine used to fill bottles. Weights for six heads on five occasions were recorded.

Usage

data(Boik)

Source

Robert J. Boik: A comparison of three invariant tests of additivity in two-way classifications with no replications, Computational Statistics \& Data Analysis, 1993.


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

Description

Compute the critical values by performing N simulation.

Usage

critical.values(a, b, N = 1e+05, alpha = 0.05)

Arguments

a

number of rows

b

number of columns

N

number of simulations

alpha

level(s) of the test

Value

A list containing three components: critical values for Johnson-Graybill, LBI and Tusell tests, respectively.

See Also

johnson.graybill.test, lbi.test, tusell.test

Examples

data(Boik)
critical.values(nrow(Boik), ncol(Boik), 0.01)

Johnson and Graybill Additivity Test

Description

Test for an interaction in two-way ANOVA table by the Johnson-Graybill test.

Usage

johnson.graybill.test(Y, alpha = 0.05, critical.value = NA, Nsim = 1000)

Arguments

Y

data matrix

alpha

level of the test

critical.value

result of critical.values function, see Details

Nsim

number of simulations to be used for a critical value estimation

Details

The critical value can be computed in advance and given in the parameter critical value. If not a function critical.values is called to do that.

Value

A list with class "aTest" containing the following components: test statistics stat, critical value critical.value and the result of the test result, i.e. whether the additivity hypothesis has been rejected.

References

Johnson, D.E. and Graybill, F.A.: An analysis of a two-way model with interaction and no replication, Journal of the American Statistical Association 67, pp. 862–868, 1972.

See Also

tukey.test, mtukey.test, mandel.test, lbi.test, tusell.test

Examples

data(Boik)
johnson.graybill.test(Boik)

Locally Best Invariant (LBI) Additivity Test

Description

Test for an interaction in two-way ANOVA table by the LBI test.

Usage

lbi.test(Y, alpha = 0.05, critical.value = NA, Nsim = 1000)

Arguments

Y

data matrix

alpha

level of the test

critical.value

result of critical.values function, see Details

Nsim

number of simulations to be used for a critical value estimation

Details

The critical value can be computed in advance and given in the parameter critical value. If not a function critical.values is called to do that.

Value

A list with class "aTest" containing the following components: test statistics stat, critical value critical.value and the result of the test result, i.e. whether the additivity hypothesis has been rejected.

References

Boik, R.J.: Testing additivity in two-way classifications with no replications:the locally best invariant test, Journal of Applied Statistics 20,pp. 41–55, 1993.

See Also

tukey.test, mtukey.test, mandel.test, johnson.graybill.test, tusell.test

Examples

data(Boik)
lbi.test(Boik)

Mandel Additivity Test

Description

Test for an interaction in two-way ANOVA table by the Mandel test.

Usage

mandel.test(data, alpha = 0.05, critical.value = NA)

Arguments

data

data matrix

alpha

level of the test

critical.value

result of critical.values function, see Details

Details

The critical value can be computed in advance and given in the parameter critical value. If not a function critical.values is called to do that.

Value

A list with class "aTest" containing the following components: test statistics stat, critical value critical.value and the result of the test result, i.e. whether the additivity hypothesis has been rejected.

References

Mandel, J.: Non-additivity in Two-way Analysis of Variance, Journal of the American Statistical Association 56, pp. 878–888, 1961.

See Also

tukey.test, mtukey.test, johnson.graybill.test, lbi.test, tusell.test

Examples

data(Boik)
mandel.test(Boik)

Modified Tukey Additivity Test

Description

Test for an interaction in two-way ANOVA table by the modified Tukey test.

Usage

mtukey.test(Y, alpha = 0.05, correction = 0, Nboot = 1000)

Arguments

Y

data matrix

alpha

level of the test

correction

type of small sample size correction (0=none, 1=bootstrap without replacement, 2=sampling), see Details

Nboot

number of simulations to be used for small sample size correction

Details

The level of the modified Tukey test is unstable for a small sample size. In such cases either bootstraping (correction=1) or sampling (correction=2) should be used to compute the critical value.

Value

A list with class "aTest" containing the following components: test statistics stat, critical value critical.value and the result of the test result, i.e. whether the additivity hypothesis has been rejected.

References

Simecek, Petr, and Simeckova, Marie. "Modification of Tukey's additivity test." Journal of Statistical Planning and Inference, 2012.

See Also

tukey.test, mandel.test, johnson.graybill.test, lbi.test, johnson.graybill.test

Examples

data(Boik)
mtukey.test(Boik)
mtukey.test(Boik,correction=2,Nboot=2000)

Tukey Additivity Test

Description

Test for an interaction in two-way ANOVA table by the Tukey test.

Usage

tukey.test(data, alpha = 0.05, critical.value = NA)

Arguments

data

data matrix

alpha

level of the test

critical.value

result of critical.values function, see Details

Details

The critical value can be computed in advance and given in the parameter critical value. If not a function critical.values is called to do that.

Value

A list with class "aTest" containing the following components: test statistics stat, critical value critical.value and the result of the test result, i.e. whether the additivity hypothesis has been rejected.

References

Tukey, J.W.: One Degree of Freedom for Non-additivity, Biometrics 5, pp. 232–242, 1949.

See Also

tusell.test, mtukey.test, mandel.test, lbi.test, johnson.graybill.test

Examples

data(Boik)
tukey.test(Boik)

Tusell Additivity Test

Description

Test for an interaction in two-way ANOVA table by the Tusell test.

Usage

tusell.test(Y, alpha = 0.05, critical.value = NA, Nsim = 1000)

Arguments

Y

data matrix

alpha

level of the test

critical.value

result of critical.values function, see Details

Nsim

number of simulations to be used for a critical value estimation

Details

The critical value can be computed in advance and given in the parameter critical value. If not a function critical.values is called to do that.

Value

A list with class "aTest" containing the following components: test statistics stat, critical value critical.value and the result of the test result, i.e. whether the additivity hypothesis has been rejected.

References

Tusell, F.: Testing for Interaction in Two-way ANOVA Tables with no Replication, Computational Statistics \& Data Analysis 10, pp. 29–45, 1990

See Also

tukey.test, mtukey.test, mandel.test, lbi.test, johnson.graybill.test

Examples

data(Boik)
tusell.test(Boik)