aovlmer.fnc {languageR}R Documentation

Compute p-values for factors in mixed models

Description

This function computes p-values for factors in a mixed-effects model. A p-value is returned based on an MCMC sample, as well as the anova table output by lmer extended with the p-values based on denominator degrees of freedom equal to the number of observations minus the number of fixed-effects coefficients. For small datasets, this p-value is anticonservative.

Usage

aovlmer.fnc(object, mcmc, which, noMCMC, ...)

Arguments

object An lmer or glmer model for a response variable fitted with lmer.
mcmc A Markov chain Monte Carlo sample obtained with pvals.fnc(..., withMCMC=TRUE)$mcmc for the lmer model.
which A vector of integers or strings denoting the rows in the table of coefficients that specify the coefficients for the factor.
noMCMC A logical indicating whether MCMC sampling should be skipped, in which case a data frame with a traditional ANOVA table is returned.
... Other optional arguments.

Value

When noMCMC == FALSE, a list with components

MCMC A list with the empirical p-value for the hypothesis that the columns of an MCMC sample specified by which have mean zero versus a general multivariate distribution with elliptical contours, and the rownames specified by which.
Ftests An anova table listing the (anticonservative) p-value based on the F-test. This table is also returned when noMCMC is set to TRUE.

Author(s)

R. H. Baayen, D. Bates

See Also

See also lmer, mcmcsamp.

Examples

        ## Not run: 
        library(lme4, keep.source=FALSE)
        library(coda)
        data(latinsquare)
        l.lmer = lmer(RT~SOA+(1|Word)+(1|Subject), data=latinsquare)
  mcmc = pvals.fnc(l.lmer, nsim=10000, withMCMC=TRUE)
  aovlmer.fnc(l.lmer, mcmc$mcmc, c("SOAmedium", "SOAshort"))
        
## End(Not run)

[Package languageR version 0.953 Index]