ezMixed( data , dv , family = gaussian , random , fixed , covariates = NULL , add_q = FALSE , fix_gam = TRUE , cov_gam = TRUE , gam_smooth = c('s','te') , gam_bs = 'ts' , gam_k = Inf
, use_bam = FALSE , alarm = FALSE , term_labels = NULL , highest = Inf , return_models = TRUE , correction = AIC , progress_dir = NULL , resume = FALSE , parallelism = 'none' , gam_args = NULL , mer_args = NULL
)
data
that contains the dependent variable. Values in this column must be numeric.
data
that contain random effects.
data
that contain fixed effects.
data
that contain variables to be used as fixed effect covariates.
fixed
on the shape of the distribution of residuals. Of course, this only really makes sense when there IS a distribution of residuals (i.e. not binomial data).
k
to supply to calls to gam. Higher values yield longer computation times but may better capture non-linear phenomena. If set to Inf
(default), ezMixed
will automatically use the maximum possible value for k given the number of unique combinations of values in the numeric predictors being evaluated. If a finite positive value is supplied, k will be set to that value or less (if the supplied k exceeds the maximum possible k for a given effect).
fixed
argument).
Inf
, will test to the highest possible order.
progress_dir
argument, the progress directory will be searched for already completed effects and resume from these. Useful if a run was interrupted.
library(doMC);options(cores=4);registerDoMC()
) and is likely only to work when running R from a unix terminal.
gam
.
lmer
, or gam
when the effect under evaluation includes a numeric predictor. Assessment of each effect of interest necessitates building two models: (1) a “unrestricted” model that contains the effect of interest plus any lower order effects and (2) a “restricted” model that contains only the lower order effects (thus “restricting” the effect of interest to zero). These are then compared by means of a likelihood ratio, which needs to be corrected to account for the additional complexity of the unrestricted model relative to the restricted model. The default applied correction is Akaike's Information Criterion (AIC), which in the context of mixed effects models has been demonstrated to be asymptotically equivalent to cross-validation, a gold-standard technique for ensuring that model comparisons optimize prediction of new data.The complexity-corrected likelihood ratio returned by ezMixed
is represented on the log-base-2 scale, which has the following convenient properties:
lmer
, glmer
, gam
, ezMixedProgress
, ezPredict
, ezPlot2
#Read in the ANT data (see ?ANT).
data(ANT)
head(ANT)
ezPrecis(ANT)
#Run ezMixed on the accurate RT data
rt = ezMixed(
data = ANT[ANT$error==0,]
, dv = .(rt)
, random = .(subnum)
, fixed = .(cue,flank,group)
)
print(rt$summary)
## Not run:
# #Run ezMixed on the error rate data
# er = ezMixed(
# data = ANT
# , dv = .(error)
# , random = .(subnum)
# , fixed = .(cue,flank,group)
# , family = 'binomial'
# )
# print(er$summary)
# ## End(Not run)
Run the code above in your browser using DataLab