Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Error extracting SAMPSTAT from output file

26 views
Skip to first unread message

Tomás Arriaza

unread,
Oct 5, 2024, 8:12:46 AM10/5/24
to MplusAutomation

I am trying to get the matrix correlation of the model, but the SAMPSTAT section was not recognized. I tried to directly install the package from the github, but it does not fix the issue. Does someone know what is eliciting this problems?

If it helps, my file is in the next link:
https://drive.google.com/file/d/1HYeotgVt0q3Va6WCFFpQa5MlKLnGcRvg/view?usp=drive_link

Two errors are displayed:

Error parsing input section of output file: AFC ICS/01. CFA/03. ics 1f25i overall both samples.out
<simpleError in if ((leadingEquals <- regexpr("^\s*[A-Za-z]+[A-Za-z_\-\d]\s(=)", cmd[1L], perl = TRUE))[1L] > 0) { cmdName <- trimSpace(substr(cmd[1L], 1, attr(leadingEquals, "capture.start") - 1)) cmdArgs <- trimSpace(substr(cmd[1L], attr(leadingEquals, "capture.start") + 1, nchar(cmd[1L])))} else { cmd.spacesplit <- strsplit(trimSpace(cmd[1L]), "\s+", perl = TRUE)[[1L]] if (length(cmd.spacesplit) < 2L) { } else { cmdName <- trimSpace(cmd.spacesplit[1L]) if (length(cmd.spacesplit) > 2L && tolower(cmd.spacesplit[2L]) %in% c("is", "are")) { cmdArgs <- paste(cmd.spacesplit[3L:length(cmd.spacesplit)], collapse = " ") } else { cmdArgs <- paste(cmd.spacesplit[2L:length(cmd.spacesplit)], collapse = " ") } }}: valor ausente donde TRUE/FALSE es necesario>

Error extracting SAMPSTAT in output file: AFC ICS/01. CFA/03. ics 1f25i overall both samples.out
<subscriptOutOfBoundsError in [<-(*tmp*, r, 1:length(line), value = line): subíndice fuera de los límites>

The warnings are:

Warning messages:
1: In strsplit(paste(section.text, collapse = " "), ";", fixed = TRUE) :
string de entrada 1 es inválida en este locale
2: In extractWarningsErrors_1file(outfiletext, curfile, input = inp) :
Could not identify warnings and errors; input is not of class mplus.inp
3: In mplus_as.numeric(splitData[[r]][-1], expect_sig = expect_sig) :
NAs introducidos por coerción

Thank you very much

michael.hallquist

unread,
Oct 5, 2024, 9:20:51 AM10/5/24
to MplusAutomation
Hi there,

This problem stems from a section header (RANDOM STARTS RESULTS RANKED FROM THE BEST TO THE WORST FIT FUNCTION VALUES) that we haven't seen in other output files before. As a result, the parser failed to terminate the SAMPSTAT section correctly. I just pushed a small fix for this problem and confirmed that your out file is now parsed correctly.

You can install the development version of the package to get this update.

#install.packages("devtools")
library(devtools)

install_github("michaelhallquist/MplusAutomation")

Cheers,
Michael

Tomás Arriaza

unread,
Oct 6, 2024, 6:07:55 PM10/6/24
to MplusAutomation
Thank you very much! It is working.

The section you mention above appears as a result of including "STARTS=20" in the Analysis command.

Tomás Arriaza

unread,
Oct 20, 2024, 8:40:48 AM10/20/24
to MplusAutomation
Hello Dr. Hallquist,

I have a new question for you. With the same file, the readModels function is not extracting technical output 4 (tech4). No errors are displayed, but an empty list.

> mplus_summaries[["X01..ics.3f25i.overall.both.samples.out"]][["tech4"]]
$X
list()
attr(,"class")
[1] "mplus.tech4" "list"

I tried to figure it on my own by checking your github, but these functions are really a whole world. Do you know what the error could be?
Reply all
Reply to author
Forward
0 new messages