Open andreaphsz opened 6 years ago
Thanks, will work on a more flexible option here. The challenge I've had is getting a "generic" summary for all the diverse types of Mplus models. That said, at the least I can make it fail gracefully and print whatever it can and just silently skip the stuff that's missing.
hello - I have a related question. I have a latent growth model with a categorical dependent variable, which runs fine and produces an output file with all fit indices eg. AIC BIC etc, identical to running the input file in Mplus. But the mplusobject does not hold any of the fit statistics. Is this a problem with the package or with my code? Here is the code: (data is in an r dataframe called df) m<- mplusObject( TITLE ="LGC; ", VARIABLE = "IDVARIABLE IS id ;CATEGORICAL = y_1 y_2 y_3 ;", ANALYSIS = "ESTIMATOR = MLR ; LINK=PROBIT ; STARTS = 10 ; ITERATIONS=5000 ;", MODEL = " i s | y_1@0 y_2@1 y_3@2 ;", OUTPUT = "TECH1 TECH4 CINTERVAL TECH10 ;" , SAVEDATA= "results;", usevariables =c("id","y_1","y_2","y_3") , rdata=df, autov = TRUE ) res<-mplusModeler(m,modelout="m.inp", check=TRUE, run=1L)
update - as a workaround, I realised adding TECH2 to the output command as an update provided the fit statistics: m1<- update(m OUTPUT = ~ "TECH2;") res1 <- mplusModeler(latgrow, modelout = "m1.inp", run = 1L)
whereas adding TECH2 to the original model command did not....
I have fitted the model as described in Chapter 9.9 in the MPlus User Guide titled "EXAMPLE 9.9: TWO-LEVEL SEM WITH CATEGORICAL FACTOR INDICATORS ON THE WITHIN LEVEL AND CLUSTER-LEVEL CONTINUOUS OBSERVED AND RANDOM INTERCEPT FACTOR INDICATORS ON THE BETWEEN LEVEL" and get the error by summarising the fitted object (see code below):
Error in sprintf("CFI = %s, TLI = %s, SRMR = %s \n", CFI, TLI, SRMR) : Object 'SRMR' not found