pvals.fnc {languageR} | R Documentation |
This function calculates p-values and HPD intervals for the
parameters of models fitted with lmer
. For the fixed-effects
parameters, anticonservative p-values based on the t statistic with
the upper bound for the degrees of freedom are added.
pvals.fnc(object, nsim = 10000, ndigits = 4, withMCMC = FALSE, ...)
object |
An lmer model for a continuous response variable
fitted with lmer . |
nsim |
An integer denoting the required number of Markov chain Monte Carlo samples. |
ndigits |
An integer denoting the number of decimal digits in the output. |
withMCMC |
A logical indicating whether the output of mcmcsamp
should be returned. |
... |
Optional arguments that can be passed down. |
A list with components
fixed |
A data frame with the estimated coefficients, their MCMC mean, the HPD 95 and the probability based on the t distribution with the number of observations minus the number of fixed-effects coefficients as degrees of freedom. This last p-value is anti-conservative, especially for small data sets. |
random |
A table with the MCMC means and HPD 95 for the standard deviations and correlations of the random effects. |
mcmc |
The output of mcmcsamp . |
R. H. Baayen
See also lmer, mcmcsamp, and HPDinterval.
data(primingHeid) library(lme4, keep.source=FALSE) # remove extreme outliers primingHeid = primingHeid[primingHeid$RT < 7.1,] # fit mixed-effects model primingHeid.lmer = lmer(RT ~ RTtoPrime * ResponseToPrime + Condition + (1|Subject) + (1|Word), data = primingHeid) primingHeid.pvals = pvals.fnc(primingHeid.lmer) primingHeid.pvals$fixed primingHeid.pvals$random