SachaEpskamp / bootnet

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

Some issues about the cormethod of ggmmodselect & NCT #124

Closed Brooks0303 closed 9 months ago

Brooks0303 commented 9 months ago

Hi Mr.Epskamp, I have the following questions when estimating the network. plz help me :)

  1. CorMethod: Im using ggmmodselect to estimate big sample‘s (N>5000) network measuring by likert scale(N>5000) network. I hope to know that which cormethod should be used to create the matrix. About 26% variable(node) violated normality according to benchmarks of skewness > |2| and/or kurtosis > |7|. In this situation, can I use the default setting of the ggmmodselect function Stepwise_unregularization<-estimateNetwork(data,default = ('ggmModSelect'),stepwise = TRUE,nCores = 8). Or I have to use spearman cor to estimate Stepwise_unregularization<-estimateNetwork(data,default = ('ggmModSelect'),stepwise = TRUE, corMethod = c("Spearman"), nCores = 8)

  2. NCT function: When I using NCT to comparing network stepNCT <- NCT(Stepwise_unregularization1,Stepwise_unregularization2,it=10,test.centrality=TRUE, test.edge=TRUE) It report an error that “in bootnet_correlate(data = data, corMethod = corMethod, corArgs = corArgs, : could not find function "bootnet_correlate"”.
    And I really didn't find this function in the environment. So I search the source codehttps://rdrr.io/cran/bootnet/src/R/defaultFunctions.R of bootnet_correlate and manual add it. Why is this error reported and is it handled correctly? And if test.edge is necessary? image

    Sorry to have taken up your time & thanks for your kind help !!!

Brooks0303 commented 9 months ago

In the first question, if "estimatenetwork" cant appoint "corMethod" argument when using default = ('ggmModSelect'). I have tried to write another piece of code, is it right?

ggmModSelect(cor(data, y = NULL, use = "everything", method = c("spearman")), n(the sample size, in this question is >5000), gamma = 0, start = c("glasso"), stepwise = TRUE, considerPerStep = c("all"), verbose = TRUE, nCores = 10, checkPD = TRUE, criterion = 'ebic')

SachaEpskamp commented 9 months ago

Hi,

Probably Spearman correlation sare the best (see https://doi.org/10.1037/met0000439). This should work:


library("bootnet")
library("NetworkComparisonTest")

net1 <- estimateNetwork(data1, default = 'ggmModSelect',stepwise = TRUE, corMethod = "spearman", nCores = 8)
net12<- estimateNetwork(data2,, default = 'ggmModSelect',stepwise = TRUE, corMethod = "spearman", nCores = 8)

NCTres <- NCT(net1, net2)