mlmsdt {sdtalt}R Documentation

Using multilevel modeling for repeated 2x2 tables

Description

Using Bates' lme4 package (2007) to run multilevel generalized linear models as an alternative to the traditional approaches to sdt. Details in Wright, Horry and Skagerberg (in press, Behavior Research Methods).

Usage

mlmsdt(subno, isold, sold, covs = NULL, lk = "logit", vardiff = TRUE, modify = TRUE, int = FALSE, item = NULL, ...)

Arguments

subno unique subject number for each individual
isold whether the person says old (1) or new (0)
sold whether the item is old (1) or new (0)
covs a list of covariates
lk link function, default = "logit" but any that can be used in lmer
vardiff whether to allow different variances for old and new items
modify used for centering covariates
int to look at interactions among covariates
item if item numbers available, a random intercept for them included
... other parameters can be passed

Details

subno - if only one unique subno is found, the function singlelevel is run. This is because lmer requires more than one subject.
isold and sold - the assumption is that these have the old values higher than the low values, but as long as they are in the same direction the d' and lnOR output will be fine. The 0/1 dummy variable coding is for ease of interpreting the coefficients. modify also affects these.
lk - it is assumed only logit and probit are used, so the output is designed for this but others can be used.
item - this allows you to run item response models. Baayen et al. (2008) is worth consulting if using this.
More complex models can be run accessing the lmer function directly.

Value

Output to the screen includes values for diagnosticity (lnOR or d').
An S4 object is created.

Author(s)

Daniel B. Wright

References

Baayen, R.H., Davidson, D.J., & Bates, D.M. (2008). Mixed-effects modeling with crossed random effects for subjects and items. Journal of Memory and Language.
Bates, D. (2007). lme4: Linear mixed-effects models using S4 classes. Version 0.99875-9. http://cran.r-project.org/.
Wright, D.B., Horry, R., & Skagerberg, E.M. (in press). Functions for traditional and multilevel approaches to signal detection theory. Behavior Research Methods.

See Also

sdt

Examples

set.seed(47)
id <- rep(1:10,each=10)
isold <- rbinom(100,1,.5)
covariate <- runif(100,0,.3)
item <- rep(1:10,10)
sayold <- rbinom(100,1,isold/4+covariate+item/50+id/50)
mlmsdt(id,isold,sayold,covariate,item=item)

[Package sdtalt version 0.1-0.1 Index]