Learn R Programming

pbkrtest (version 0.5.4)

comodex: Model comparison

Description

Wrapper for functions KRmodcomp, SATmodcomp, PBmodcomp, X2modcomp

Usage

comodex(
  largeModel,
  smallModel,
  test = "x2",
  control = list(),
  details = 0,
  ...
)

# S3 method for lmerMod comodex( largeModel, smallModel, test = "x2", control = list(), details = 0, ... )

# S3 method for default comodex( largeModel, smallModel, test = "x2", control = list(), details = 0, ... )

Arguments

largeModel

A model object

smallModel

A model object, a formula or a restriction matrix

test

A character string

control

A list controlling the model comparions.

details

should details be printed

...

Additional arguments to be passed on to other methods

Author

Søren Højsgaard

Examples

Run this code
(lmm0 <- lmer(Reaction ~ (Days|Subject), sleepstudy))
(lmm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
(lmm2 <- lmer(Reaction ~ Days + I(Days^2) + (Days|Subject), sleepstudy))

lm1 <- lm(dist ~ speed + I(speed^2), data=cars)
lm0 <- lm(dist ~ speed, data=cars)

comodex(lmm2, lmm1, test="x2")
comodex(lmm2, lmm1, test="kr")
comodex(lmm2, lmm1, test="sat")
comodex(lmm2, lmm1, test="PB", control=list(nsim=50, cl=1))
comodex(lmm2, .~. - I(Days^2))

comodex(lm1, lm0)
comodex(lm1, lm0, test="pb", control=list(nsim=50, cl=1))

Run the code above in your browser using DataLab