在ergm
包中,nodematch
允许我们指定同性恋。但是,我注意到它只允许二元,字符向量。有没有办法将收入等连续变量纳入ergm
函数?
以下内容取自小插图:
library(ergm)
data(flo)
flomarriage <- network(flo,directed=FALSE)
wealth=c(10,36,27,146,55,44,20,8,42,103,48,49,10,48,32,3)
flomarriage %v% "wealth" <- wealth
data(florentine)
#
# Fit a model where the propensity to form ties between
# families depends on the absolute difference in wealth
#
gest <- ergm(flomarriage ~ edges + absdiff("wealth"))
summary(gest)
似乎上面处理一个连续变量,但使用绝对差异。 ergm无法处理连续变量吗?