I am trying to fix some of the parameters in one of my models because I'd like to test parameters from a previous model on new data. I saw that you can set the est column to FALSE and the parameters won't change even when you run a new model. When I ran the second model with the parameters from the first model, the M2 values change drastically, and I do not know why. Any suggestions on why this is happening? I noticed that in mod, df=1 and in mod2, df=36.
data <- read.csv( "ItemFit_TestData.csv")
data <- data[,c(2:11)]
data <- na.omit(data)
ItemType <- c("2PL", "2PL", "graded","graded","graded","graded","graded", "graded")
mod<- mirt(data[,c(3:ncol(data))],
model = 1,
itemtype=ItemType,
method = "EM",
survey.weights = data$`Individual_MIRTData$V258.x`)
summary(mod)
mod@Fit
M2(mod, type="M2*") # the model seems to have decent global fit values RMSEA = 0.09, CFI=0.99, TLI =0.94
itemfit(mod) #none of the items seem to fit
itemfit(mod, empirical.plot = 1) #visually the items seem to fit
itemfit(mod, empirical.plot = 3) #visually the items seem to fit
itemfit(mod, empirical.plot = 5) #visually the items seem to fit
values<- mod2values(mod) #made this to determine how many parameters I needed
values$est <- FALSE #so that model uses exact same parameters
mod2<- mirt(data[,c(3:ncol(data))],
model = 1,
itemtype=ItemType,
pars=values,
survey.weights = data$`Individual_MIRTData$V258.x`)
mod2@Fit #same values as mod
M2(mod2, type="M2*") #now the df is 36 instead of 1
itemfit(mod2)
itemfit(mod2, empirical.plot = 1)
The other slightly confusing part of this example is the difference between the item fit and the model fit. The item fit visually looks good, but the S_X2 values imply poor fit. What would cause this difference?