I am quite an ergm newbie, so forgive me if the answer to my question is obvious to you. I modeled my network using ergms and try to facilitate interpretability by using the AMEs of ergms (function: ergm.AME()). Here, R returns two error messages:
- Error in t(x) %*% cbcoef : non-conformable arguments and an additional warning message:
- In edge.prob2(model) : There are structural zeros or ones. For these dyads, the predicted probabilities are not valid and must be manually replaced by 0 or 1, respectively.
I tried to find questions on both topics on stack overflow but could not find any. Do you know what the problem is? I do not have any problems when calculating the models using ergm.
For these models the code works:
model1 <- ergm(
network ~ edges + mutual + gwidegree(decay=1, fixed=TRUE) +
gwodegree(decay=1, fixed=TRUE),
estimate = "MPLE"
)
model2 <- ergm(
network ~ edges + mutual + gwidegree(decay=1, fixed=TRUE) +
gwodegree(decay=1, fixed=TRUE) + gwesp(decay=1, fixed=TRUE),
estimate = "MPLE"
)
model3 <- ergm.AME(model1, "edges")
model4 <- ergm.AME(model2, "edges")
However, when using a more complex model, the error messages occur:
model5 <- ergm(
network ~ edges + mutual + gwidegree(decay=1, fixed=TRUE) +
gwodegree(decay=1, fixed=TRUE) + gwesp(decay=1, fixed=TRUE) +
edgecov(network1) + edgecov(network2) + edgecov(network3) +
edgecov(network4) + nodeifactor("chronic") +
nodeofactor("chronic") +nodeifactor("nas") +
nodeofactor("nas") + nodeofactor("sup") +
nodematch("chronic") + nodematch("nas") +
nodematch("gender") + nodefactor("gender"),
estimate = "MPLE"
)
Can you expand the question with the output of
summary(model5)? There might be several reasons for that, but the one I'm suspecting is that your model has some of the coefficient estimates atInfor-Inf. This trips the calculation of dyadic tie probabilities which are necessary to compute AMEs. Generally speaking, you may have not enough "variability" in your data to estimate a model that complex.Thus the solution for you would be: