Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

randef

Compute posterior estimates of random effect


Description

Stochastically compute random effects for MixedClass objects with Metropolis-Hastings samplers and averaging over the draws. Returns a list of the estimated effects.

Usage

randef(x, ndraws = 1000, thin = 10, return.draws = FALSE)

Arguments

x

an estimated model object from the mixedmirt function

ndraws

total number of draws to perform. Default is 1000

thin

amount of thinning to apply. Default is to use every 10th draw

return.draws

logical; return a list containing the thinned draws of the posterior?

Author(s)

References

Chalmers, R., P. (2012). mirt: A Multidimensional Item Response Theory Package for the R Environment. Journal of Statistical Software, 48(6), 1-29.

Chalmers, R. P. (2015). Extended Mixed-Effects Item Response Models with the MH-RM Algorithm. Journal of Educational Measurement, 52, 200-222. doi: 10.1111/jedm.12072 doi: 10.18637/jss.v048.i06

Examples

## Not run: 
#make an arbitrary groups
covdat <- data.frame(group = rep(paste0('group', 1:49), each=nrow(Science)/49))

#partial credit model
mod <- mixedmirt(Science, covdat, model=1, random = ~ 1|group)
summary(mod)

effects <- randef(mod, ndraws = 2000, thin = 20)
head(effects$Theta)
head(effects$group)


## End(Not run)

mirt

Multidimensional Item Response Theory

v1.33.2
GPL (>= 3)
Authors
Phil Chalmers [aut, cre] (<https://orcid.org/0000-0001-5332-2810>), Joshua Pritikin [ctb], Alexander Robitzsch [ctb], Mateusz Zoltak [ctb], KwonHyun Kim [ctb], Carl F. Falk [ctb], Adam Meade [ctb], Lennart Schneider [ctb], David King [ctb], Chen-Wei Liu [ctb], Ogreden Oguzhan [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.