I am new to mirt models and tried to estimate a graded response model with the mirt-package in Rstudio using the mirt command:
x <- pid[,c(items.25,items.1,items.13)]
#x= dataframe with 1228 observations of 24 variables
# define bifactor model
#model syntax
mirtsyn <- paste0("G = ",paste0(colnames(x), collapse = ","),"\n",
"F1 = ",paste0(items.25,collapse = ","),"\n",
"F2 = ",paste0(items.1,collapse = ","),"\n",
"F3 = ",paste0(items.13,collapse = ","))
mirtmodel <- mirt.model(mirtsyn, itemnames=colnames(x))
# estimate model
fit <- mirt(x,model = mirtmodel,itemtype = "graded", SE = FALSE, method = "MHRM")
#itemtype = graded means its using a graded response model,
#method= MHRM (Metropolis-Hastings Robbins-Monro) means it uses stochastic methods for estimation'
I got this error message:
Error in draw.thetas(theta0 = gtheta0[[g]], pars = pars[[g]], fulldata = Data$fulldata[[g]], :
MH sampler failed. Model is likely unstable or may need better starting valuesFALSE