1

I am having trouble using the estimateNetwork function in the mgm package. Trying to run a mixed graphical model. I can visualize the network using igraph, but can't compute the network indices. Any advice?

library(haven)
flordiss <- read_sav("C:/Users/schul/OneDrive/Desktop/flordiss.sav")
View(flordiss)
library(mgm)
library(huge)
library(glasso)
library(qgraph)
library(bootnet)
mydata<-flordiss
mydata_matrix <- as.matrix(mydata)
my_model <- estimateNetwork(mydata_matrix, reg = "mgl", standardize = TRUE)
Error in do.call(.input$estimator, c(list(data), .input$arguments)) : 
'what' must be a function or character string
In addition: Warning messages:
1: In formals(fun) : argument is not a function
2: In formals(fun) : argument is not a function

I tried reloading the mgm package, restarting R, ensuring estimateNetwork was loaded.

r2evans
  • 141,215
  • 6
  • 77
  • 149
Kaitlyn
  • 11
  • 1
  • 2
    I do not see a function named `estimateNetwork` [in the mgm package](https://rdrr.io/cran/mgm/api/). The function seems to be supplied by [the bootnet package](https://rdrr.io/cran/bootnet/man/estimateNetwork.html) and it takes different arguments to those in your code, which probably explains the errors. – neilfws Mar 28 '23 at 00:57

0 Answers0