Hi Katie and all,
I recently updated to 0.8 and am running into several strange issues involving data input, plot outputs, and overall outputs. I'll document what I've gone through below. Katie, happy to pass along data or outputs if you'd like, just email me privately!
The background is I recently ran CS-GIMME and got a subgroup-level path that was significant for fewer individuals than the cutoff should allow, but then I saw 0.8 was upgraded to address this. So, I updated to 0.8, ran the code below, and got the error below. Strangely, GIMME succesfully ran before updating and I did not change anything in the code or data or directories.
Code:
library(tidyverse)
library(gimme)
library(lavaan)
tx.out_inc <- read.csv('S:/CADEPP/MattM/CATSData/GIMME_Revised/tx.out_inc.csv')
#CS_GIMME
CATS_c67 <- gimmeSEM(data = 'S:/CADEPP/MattM/CATSData/GIMME_Revised/ts_scrubbed',
sep = ",",
header = T,
out = 'S:/CADEPP/MattM/CATSData/GIMME_Revised/Output',
ar = T,
plot = T,
subgroup = T,
confirm_subgroup = tx.out_inc,
subcutoff = .67,
standardize = T,
groupcutoff = .75)
error:
Error in data[[1]][1, ] : incorrect number of dimensions
To try to fix this, I first tried a default command, which gave the same error:
CATS_c67 <- gimmeSEM(data = 'S:/CADEPP/MattM/CATSData/GIMME_Revised/ts_scrubbed')
Error in data[[1]][1, ] : incorrect number of dimensions
I then tried setting plot to F, and did NOT get the error, indicating something may be going wrong with plots.
I then tried loading the files into a list, and trying that as the input data:
csv_files <- list.files('S:/CADEPP/MattM/CATSData/GIMME_Revised/ts_scrubbed', full.names = TRUE)
csv_list <- lapply(csv_files, read.csv)
names(csv_list) <- tx.out_inc$subj
(same gimme command as above, but replace directory with csv_list)
This did not produce an error and ran through GIMME. This is strange because it suggests my data format works with GIMME. I also know this should be true because it was working before updating to 0.8, and I did not change anything. Not sure why it would work with a list and not the csvs. Additionally, GIMME generated a file in the working directory titled " Errors in plotting occur with fewer than 4 nodes" that when I open it in a text editor reads "WARNING: plot=TRUE changed to plot=FALSE." I have 15 nodes, so this should not be happening. When GIMME finished, there were indeed no plots. Additionally, I got a subgroup-level path for a path that only exists in 16/29 subjects in the subgroup, which is under my 67% threshold.
To further test if it was an issue with my data or something else, I ran the simulated gimme data as so:
data("simData", package = "gimme")
outGIMME <- gimme(data = simData, out='S:/CADEPP/MattM/CATSData/GIMME_Revised/Output_test')
and it generated that same plot warning file, seemingly incorrectly.
Not sure what's going on! There seems to be issues with (1) data input, potentially related to plot, (2) gimme not recognizing the correc number of nodes, and (3) still getting subgroups below my treshold.
Definitely open to solutions, the only thing I can think to do in the meantime is to downgrade to an older version of gimme (so it runs) and not run the confirmatory subgroups (to not get a subgroup that is below my threshold).
Please let me know if further info would be helpful!
Best,
Matt