Dear all
I am trying to run a saturated model but there is something wrong in the way I have have ordered the variables, as I received this error message:
Error: In model 'Sat' column 'dm1' is not an ordered factor. Use mxFactor() on this column.
So, I did the following after the reshape command:
TwDEP_DM <- reshape(DEP_DM, idvar = c("PAIRID", "ZYG"), timevar = "TVAB", direction = "wide")
colnames(TwDEP_DM) <- c('PAIRID', 'ZYG', 'dm1', 'dep1', 'age1','dm2', 'dep2', 'age2')
TwDEP_DM$dm1 <- mxFactor(TwDEP_DM$dm1, levels=c(0:2), ordered = TRUE)
TwDEP_DM$dep1 <- mxFactor(TwDEP_DM$dep1, levels=c(0:2), ordered = TRUE)
TwDEP_DM$dm2 <- mxFactor(TwDEP_DM$dm2, levels=c(0:2), ordered = TRUE)
TwDEP_DM$dep2 <- mxFactor(TwDEP_DM$dep2, levels=c(0:2), ordered = TRUE)
But:
> SatFit <- mxRun(SatModel, intervals=F)
Running Sat
Error: In model 'Sat' I was expecting 1 thresholds in column 'dm1' of matrix/algebra 'MZ.expThresMZ' but I hit NA values after only 0 thresholds. You need to increase the number of free thresholds for 'dm1' and give them values other than NA
Is there anything I can do differently?
I think there is something in the mxFactor () as all of the "0" has been replaced as "1"; "1" with "2" ...
I have tried:
TwDEP_DM$dm1 <- mxFactor(TwDEP_DM$dm1, levels=c(0:2), exclude NA, ordered = TRUE)
TwDEP_DM$dm1 <- mxFactor(TwDEP_DM$dm1, levels=c(0:2), labels (2, NA), ordered = TRUE)
Any help will be much appreciated.
Kind regards
Carol