# Obtaining p-values in random effects models in R

The pvals.fnc procedure which uses Monte-Carlo Markov Chain simulations to compute p-values for terms in random effect models will run in R 2,.10 and above with the lmer procedure which is in the lme4 library. An example of its use to assess differences between conditions (assumed to be fixed effects) is given below.

library(foreign) x <- read.spss("C:\\Documents and Settings\\peterw\\Desktop\\My Documents\\My Documents2\\SAMI R LME4\\mask.sav") attach(x) library(lme4) install.packages("languageR") library(languageR) model <- lmer(ptotalfs ~ condition + (1|subj)) pvals.fnc(model)