使用R软件包RSiena,我该如何测试合身度?

时间:2016-05-14 02:05:18

标签: r

我希望能够测试我的拟合模型是否能很好地表示数据,例如:

myalgorithm <- sienaAlgorithmCreate(nsub=2, n3=100)
# nsub=2 and n3=100 is used here for having a brief computation, not for practice.
mynet1 <- sienaDependent(array(c(tmp3, tmp4), dim=c(32, 32, 2)))
mydata <- sienaDataCreate(mynet1)
myeff <- getEffects(mydata)
ans <- siena07(myalgorithm, data=mydata, effects=myeff, batch=TRUE)

如何检查ans中的学位分布是否合适?

1 个答案:

答案 0 :(得分:1)

我找到了。使用sienaGOF

mynet1 <- sienaDependent(array(c(s501, s502, s503), dim=c(50, 50, 3)))
mynet2 <- sienaDependent(array(c(s503, s502, s501), dim=c(50, 50, 3)))
mybeh <- sienaDependent(s50a, type='behavior')
mydata <- sienaDataCreate(mynet1, mynet2, mybeh)
myeff <- getEffects(mydata)
myeff <- includeEffects(myeff, transTrip)
myeff <- includeEffects(myeff, recip, name="mynet2")
myeff <- setEffect(myeff, cycle3, fix=TRUE, test=TRUE, include=TRUE)
myeff  <- setEffect(myeff, nbrDist2, fix=TRUE, test=TRUE, include=TRUE)
myeff <- setEffect(myeff, transTies, fix=TRUE, test=TRUE, include=TRUE)
myalgorithm <- sienaAlgorithmCreate(n3=200)
ans <- siena07(myalgorithm, data=mydata, effects=myeff, returnDeps=TRUE)
gofi <- sienaGOF(ans, IndegreeDistribution, verbose=TRUE, join=TRUE,
                varName="mynet1")

您甚至可以绘制结果图表以查看观察数据的位置。