-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Dear,
I hope this email finds you well. I am currently a Ph. student at KAIST, studying network theory using the ERGM package in R language. I wanted to express my gratitude for your packages in my studies.
I have a question regarding the 'diff-ergmTerm' in the ERGM package, specifically related to the directionality of the tail-head and the use of posonly and negonly.
I created a network with 19 nodes (numbered from 1 to 19) and assigned sequential attributions to each node, with higher attribution values for smaller node numbers (e.g., 1 having the highest attribution and the attribution decreasing as the node number increases).
Then, I generated edges using code to create links with higher probabilities from nodes with higher attribution to nodes with lower attribution.
Specifically, I designed the links to have a higher probability of tail(i)-head(j) with a positive sign.action(attr[i]-attr[j]) in the 'diff' function.
However, when I included both "diff('Att', pow=1, dir="t-h", sign.action="posonly")" and "diff('Att', pow=1, dir="t-h", sign.action="negonly")" in the code and ran it, I obtained unexpected results, where 'negonly' showed statistically significant effects instead of 'posonly'.
I would appreciate it if you could review my code and data set to confirm if my interpretation and implementation are correct. Please find the attached data set and code for your reference.
Thank you in advance for your assistance.
Best regards,
Deok-Young Lee.
Datasets:
test_edge.csv
test_node.csv
Result I got:
diff_results
Codes:
library('ergm')
library('igraph')
library('intergraph')
link_test <- read.csv("test_edge.csv")
G <- graph.data.frame(link_test[, c(1,2)], directed = TRUE)
property_test <- read.csv("test_node.csv")
colnames(property_test)
V(G)$Att <- property_test[,2]
nx_test <- asNetwork(G, ignore.eval=FALSE)
nx_test
base_test <- ergm(nx_test ~ edges)
base_test_diffsign <- ergm(nx_test ~ edges
+ diff('Att', pow=1, dir="t-h", sign.action="posonly")
+ diff('Att', pow=1, dir="t-h", sign.action="negonly"))
summary(base_test_diffsign)