Learn R Programming

ESTER (version 0.1.0)

seqER: Computes sequential evidence ratios

Description

Computes sequential evidence ratios, either based on the AIC or the BIC. Supported models currently include lm or merMod models. When data involve repeated measures (and so multiple lines per subject), a column indicating the subject "id" should be provided to the id argument. If nothing is passed to the id argument, seqER will suppose that there is only one observation (i.e., one line) per subject.

Usage

seqER(ic, mod1, mod2, nmin, id = NULL)

Arguments

ic

Indicates whether to use the aic or the bic.

mod1

A model of class lm or lmerMod.

mod2

A model of class lm or lmerMod (of the same class of mod1).

nmin

Minimum sample size from which start to compute sequential evidence ratios.

id

If applicable (i.e., repeated measures), name of the "id" column of your dataframe, in character string.

See Also

seqERboot

Examples

Run this code
# NOT RUN {
data(mtcars)
mod1 <- lm(mpg ~ cyl, mtcars)
mod2 <- lm(mpg ~ cyl + disp, mtcars)
seq_mtcars <- seqER(ic = aic, mod1, mod2, nmin = 10)

# Example with repeated measures
library(lme4)
data(sleepstudy)
mod1 <- lmer(Reaction ~ Days + (1|Subject), sleepstudy)
mod2 <- lmer(Reaction ~ Days + I(Days^2) + (1|Subject), sleepstudy)
seqER(ic = aic, mod1, mod2, nmin = 10, id = "Subject")

# }

Run the code above in your browser using DataLab