Replies: 1 comment 1 reply
-
|
Can I trouble you to point me to those snippets? They look to be misleading. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am currently working on fitting a STERGM model in R and I have been trying to perform goodness-of-fit tests using various code snippets I found online. However, I keep encountering errors, and I'm not sure how to resolve them.
The error message I receive is as follows (please see the attached screenshot for reference).
Code is as follows:
`
library(tergm)
library(network)
library(ergm)
set.seed(123)
n <- 10 ; T <- 5
network_list <- list()
for (t in 1:T) {
mat <- matrix(rbinom(n*n, 1, 0.1), n, n)
diag(mat) <- 0
net <- network(mat, directed = TRUE)
network_list[[t]] <- net
}
model1 <- stergm(
network_list,
formation = ~ edges + mutual,
dissolution = ~ edges,
estimate = "CMLE"
)
summary(model1)
sim_nets <- simulate(model1,
nsim = 100,
time.slices = T,
output = "network")
gof_stats <- c("idegree", "odegree", "espartners", "distance", "triadcensus")
gof_results <- gof(model1,
GOF = gof_stats,
control = control.gof.ergm(nsim = 10),
target = network_list[[5]])
plot(gof_results)
`
If you could provide any guidance or suggestions on how to troubleshoot this problem, I would greatly appreciate it. Additionally, if there are any specific packages or functions you recommend for conducting goodness-of-fit tests for STERGM models, I would be eager to learn about them.
Thank you for your time and assistance. I look forward to your response.
Beta Was this translation helpful? Give feedback.
All reactions