Skip to content

Assistance Needed with STERGM Goodness-of-Fit Test Errors #132

@Yetta5208

Description

@Yetta5208

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).

Image Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions