diff --git a/R/mod2values.R b/R/mod2values.R index 255cad93d..4e28ebe40 100644 --- a/R/mod2values.R +++ b/R/mod2values.R @@ -27,6 +27,11 @@ #' #' # use the converted values as starting values in a new model, and reduce TOL #' mod2 <- mirt(dat, 1, pars = values, TOL=1e-5) +#' coef(mod2, simplify=TRUE) +#' +#' # use parameters on different dataset +#' mod3 <- mirt(expand.table(LSAT6), pars=values) +#' coef(mod3, simplify=TRUE) #' #' # supports differing itemtypes on second model #' sv <- mirt(Science, itemtype=c('graded', rep('gpcm', 3)), pars='values') diff --git a/R/utils.R b/R/utils.R index 654dfcc1e..ff6e5a804 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1219,8 +1219,8 @@ UpdatePrepList <- function(PrepList, pars, random, lr.random, clist, nclist, if(nrow(currentDesign) != nrow(pars)) stop('Rows in supplied and starting value data.frame objects do not match. Were the data or itemtype input arguments modified?', call.=FALSE) - if(!all(as.matrix(currentDesign[,c('group', 'item', 'class', 'name', 'parnum')]) == - as.matrix(pars[,c('group', 'item', 'class', 'name', 'parnum')]))) + if(!all(as.matrix(currentDesign[,c('group', 'class', 'name', 'parnum')]) == + as.matrix(pars[,c('group', 'class', 'name', 'parnum')]))) stop('Critical internal parameter labels do not match those returned from pars = \'values\'', call.=FALSE) if(!all(sapply(currentDesign, class) == sapply(pars, class))) diff --git a/man/mod2values.Rd b/man/mod2values.Rd index ca028532a..e9b9d0cff 100644 --- a/man/mod2values.Rd +++ b/man/mod2values.Rd @@ -25,6 +25,11 @@ values # use the converted values as starting values in a new model, and reduce TOL mod2 <- mirt(dat, 1, pars = values, TOL=1e-5) +coef(mod2, simplify=TRUE) + +# use parameters on different dataset +mod3 <- mirt(expand.table(LSAT6), pars=values) +coef(mod3, simplify=TRUE) # supports differing itemtypes on second model sv <- mirt(Science, itemtype=c('graded', rep('gpcm', 3)), pars='values')