anova.mvl1lm: Comparisons between Multivariate Linear Models

View source: R/anova.mvl1lm.R

anova.mvl1lmR Documentation

Comparisons between Multivariate Linear Models

Description

Comparisons between nested multivariate linear models fitted by mv.l1lm. The comparison can be based on score type of tests and Wald type of tests.

Usage

## S3 method for class 'mvl1lm'
anova(object, object2 = NULL, test = "Score", ...)

Arguments

object

an object of class mvl1lm. This gives the full model.

object2

an object of class mvl1lm or NULL. This gives the restricted (nested) model.

test

The test to be used. Options are Score and Wald. The score version is the default.

...

needed for other methods.

Details

If only object is provided the function tests if all parameters equal zero. If object and object2 are provided the function tests the null hypothesis that the the restricted model (object2) is true. For details see chapter 13 of the MNM book. Note that it is the users responsibility to make sure that the two models are nested and fitted on the same data. For the regular L2 regression anova.mlm provides more options.

Value

A list with class 'anovamvl1lm' containing the following components:

models

the model call(s) of object and object2.

method

type of the test used.

statistic

value of the test statistic.

parameter

degrees of freedom.

p.value

p-value of the test.

Author(s)

Klaus Nordhausen

References

Oja, H. (2010), Multivariate Nonparametric Methods with R, Springer.

Nordhausen, K. and Oja, H. (2011), Multivariate L1 Methods: The Package MNM, Journal of Statistical Software, 43, 1-28.

Examples

# creating simple data

X <- cbind(rep(1,100),rmvnorm(100,c(0,0,0)) )
B <- matrix(c(4,1,1,0.5,-3,2,2,2),ncol=4, byrow=TRUE)
Y <- X %*% t(B)+ rmvnorm(100,c(0,0), diag(0.2,2))
DAT <- data.frame(x1=X[,2],x2=X[,3], x3=X[,4])

FullModel <- mv.l1lm(Y ~ x1 + x2 + x3, scores= "s", stand="i", data=DAT)
RestModel <- mv.l1lm(Y ~ x1, scores= "s", stand="i", data=DAT)

anova(FullModel)
anova(FullModel, RestModel)
anova(FullModel, RestModel, test="W")

MNM documentation built on May 29, 2024, 8:49 a.m.