GOF error
Closed this issue · 4 comments
Hi,
I'm fitting an ergm to a network tried to use the gof function provided in this package. Unfortunately, trying to run the command leaves me with the following error message:
> xergm.common::gof(model0a)
Starting GOF assessment on a single computing core....
Error in adjust(nw.k, nw.j, remove = FALSE, value = 1, returnlabels = TRUE) :
At t = 1, there are 103 duplicate target column names.```
Any idea what could cause this behavior?
It might mean that the first matrix in the list (either the dependent variable or some matrix on the right-hand side of the formula) has duplicate column names. The function tries to adjust the dimensions of all networks to each other if some nodes are missing. To do that, it checks the row and column labels. You could check if that might be the case applying the colnames
function to the matrices that go into your model. If that does not help, please feel free to post a working example, which I can use to diagnose the problem.
I think I know what the problem might be:
I am using an external matrix as an edge covariate so basically the ergm formula looks something like this:
ergm( net ~ edges ... edgecov(ext_matrix))
with ext_matrix
being a square matrix that is not directly stored in the net
object. I do not get these errors when I have a network where all information is stored within the network!
I use external matrices all the time; this cannot be the cause of the problem. Have you tried following my advice above? Can you provide a minimal self-contained example that I can use to look into the problem? Thanks.
Closing this due to lack of activity. Please feel free to post follow-up questions later.