SachaEpskamp / bootnet

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

Error when non-parametric bootstrapping #28

Closed patkgoh closed 5 years ago

patkgoh commented 5 years ago

Hi Sacha,

I'm getting an error in bootnet when calculating edge weight stability.

***ESTIMATE NETWORK-RELATED OUTPUT

W1_Network <- estimateNetwork(W1, default = "EBICglasso") Estimating Network. Using package::function:

***BOOTSTRAPPING-RELATED OUTPUT

boot1a <- bootnet(W1_Network, nBoots = 100, type = "nonparametric", nCores = 4, statistics = c("betweenness","closeness", "expectedInfluence")) Note: bootnet will store only the following statistics: betweenness, closeness, expectedInfluence Estimating sample network... Estimating Network. Using package::function:

  • qgraph::EBICglasso for EBIC model selection
  • using glasso::glasso
  • qgraph::cor_auto for correlation computation
  • using lavaan::lavCor Variables detected as ordinal: CarelessMistakes; SustainAttn; Daydreams; FollowInstrux; Organizing; MentalEffort; LosesThings; EasilyDistract; Forgetful; Fidgets; RemainsSeat; RunsClimbs; PlaysQuietly; Motor; TalksExcessive; Blurts; WaitTurn; Intrudes Bootstrapping... |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 37s Computing statistics... |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 02s Warning message: In EBICglassoCore(S = S, n = n, gamma = gamma, penalize.diagonal = penalize.diagonal, : A dense regularized network was selected (lambda < 0.1 * lambda.max). Recent work indicates a possible drop in specificity. Interpret the presence of the smallest edges with care. Setting threshold = TRUE will enforce high specificity, at the cost of sensitivity.

plot(boot1a, labels = FALSE, order = "sample") Expected significance level given number of bootstrap samples is approximately: 0.051 Error in $<-.data.frame(*tmp*, "fill", value = "same") : replacement has 1 row, data has 0

SachaEpskamp commented 5 years ago

This is because the plot method defaults to strength, which is not included in your bootstrap. I now made this error message clearer. This should work: plot(boot1a, labels = FALSE, order = "sample", statistics = "closeness")