View source: R/estimate_mupp_parameters_.R
estimate_mupp_params | R Documentation |
Estimate MUPP statement and person parameters given item responses and item properties using MCMC
estimate_mupp_params(resp, items, method = "MCMC", control = list(), ...)
resp |
a data.frame of (at least) |
items |
a data.frame of (at least) |
method |
the estimation method (MCMC is the only one that works now) |
control |
a list of parameters to control the algorithm. See details. |
... |
other parameters to pass to the estimation algorithm. See details. |
For MCMC, additional parameters include
a named list with names indicating the parameter and values indicating the starting values/initial parameter estimates
a character vector with elements that are fixed to their initial parameters for the entire estimation algorithm
For MCMC, control parameters include
total number of iterations.
number of iterations to throw away when calculating summary statistics.
the standard deviation of the step size for subsequent Metropolis-Hastings draws.
a list of [theta, params]
arrays with the third dimension indicating
the iteration as well as means and sds
Steven Nydick, steven.nydick@kornferry.com
## Not run: set.seed(3452345) # simulate parameters and responses to the model # (assumption is that params/resp will follow conventions) params <- simulate_mupp_params(n_persons = 100, n_items = 300, n_dims = 9, max_item_dims = 2, unidim_items = TRUE) resp <- do.call(simulate_mupp_resp, params) # thetas for comparison thetas <- tidyr::spread(params$persons, key = "dim", value = "theta")[ , -1] items <- params$items # estimating thetas using algorithm (one start for comparison purposes) est_params <- estimate_mupp_params(resp = resp$resp, items = resp$items, method = "MCMC", control = list(n_iters = 1000, n_burnin = 500), initial_params = list(delta = sign(items$delta))) # correlating (not great, but small iters and few people) diag(cor(thetas, est_params$means$thetas)) cor(items$alpha, est_params$means$alpha) cor(items$delta, est_params$means$delta) cor(items$tau, est_params$mean$tau) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.