[Rsiena-commits] r287 - pkg/RSienaTest/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 2 16:39:37 CEST 2015


Author: cws_rug
Date: 2015-06-02 16:39:37 +0200 (Tue, 02 Jun 2015)
New Revision: 287

Modified:
   pkg/RSienaTest/R/sienaGOF.r
Log:
- Bug fix that relates to biased GOF statistics for bipartite networks
- In bipartite matrices, diagonal elements were set to zero. 

Modified: pkg/RSienaTest/R/sienaGOF.r
===================================================================
--- pkg/RSienaTest/R/sienaGOF.r	2015-05-21 09:20:31 UTC (rev 286)
+++ pkg/RSienaTest/R/sienaGOF.r	2015-06-02 14:39:37 UTC (rev 287)
@@ -882,6 +882,7 @@
 sparseMatrixExtraction <-
 	function(i, obsData, sims, period, groupName, varName){
 	# require(Matrix)
+	isBipartite <- "bipartite" == attr(obsData[[groupName]]$depvars[[varName]], "type")
 	dimsOfDepVar<- attr(obsData[[groupName]]$depvars[[varName]], "netdims")
 	if (attr(obsData[[groupName]]$depvars[[varName]], "sparse"))
 	{
@@ -918,7 +919,7 @@
 			returnValue <- changeToStructural(returnValue,
 				Matrix(obsData[[groupName]]$depvars[[varName]][,,period]))
 		}
-		diag(returnValue) <- 0 # not guaranteed by data input
+		if(!isBipartite) diag(returnValue) <- 0 # not guaranteed by data input
 	}
 	else
 	{



More information about the Rsiena-commits mailing list