SachaEpskamp / bootnet

Bootstrap methods for various network estimation routines
30 stars 14 forks source link

Error when calculating multiple statistics using bootnet #134

Open KaiyeeHe opened 1 month ago

KaiyeeHe commented 1 month ago

Hi Sacha,

I encountered an issue when using the bootnet function to calculate multiple statistics simultaneously (plz see the figure below). While calculating statistics separately works fine, the function fails when I attempt to compute multiple statistics in one call.

image

The current version of my system is: R version: 4.3.1 bootnet version: 1.6

Is it possible that this might be due to my mixed-mode data, which includes both continuous and categorical variables? Looking forward to your thoughts and suggestions! Thank you a lot!

SachaEpskamp commented 1 month ago

Hi! Can you supply a reproducible example? And does the problem persist after updating R and all packages with update.packages(ask=FALSE)?

KaiyeeHe commented 1 month ago

Hi! Can you supply a reproducible example? And does the problem persist after updating R and all packages with update.packages(ask=FALSE)?

Hi! Thank you for your reply! I have tried updating and rerunning the code, but it did not work as expected. However, I found that the function works well when I do not specify the labels in the estimateNetwork function.

For your reference, here are the details:

Previous code that caused an error:

Model <- estimateNetwork( data = obj_stressors$data, default = "mgm", type = obj_stressors$type, level = obj_stressors$level, criterion = "EBIC", corMethod = "cor_auto", labels = c(1:19) # Note that I specified labels here ) bootnet::bootnet(Model, ncores = 7, nboots = 2, type = "case")

The error was like image

Current version that works well:

Model <- estimateNetwork( data = obj_stressors$data, default = "mgm", type = obj_stressors$type, level = obj_stressors$level, criterion = "EBIC", corMethod = "cor_auto" # labels = c(1:19) # Note that I did not specify labels here and it works ) bootnet::bootnet(Model, ncores = 7, nboots = 2, type = "case")

Thank you again for your help! :)