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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 9 21:50:02 CEST 2010


Author: jalospinoso
Date: 2010-06-09 21:50:02 +0200 (Wed, 09 Jun 2010)
New Revision: 101

Modified:
   pkg/RSienaTest/R/sienaTimeTest.r
Log:
Fixed bug with RateX and varCovars.

Modified: pkg/RSienaTest/R/sienaTimeTest.r
===================================================================
--- pkg/RSienaTest/R/sienaTimeTest.r	2010-06-08 17:17:01 UTC (rev 100)
+++ pkg/RSienaTest/R/sienaTimeTest.r	2010-06-09 19:50:02 UTC (rev 101)
@@ -59,7 +59,7 @@
 	}
 	## If the estimation was unconditional, the rate parameters will have scores
 	## and moments which must also be screened out. Ruth, is there a simple way to
-	## check conditioning? I tried $conditional and it doesn't seem to do what I
+	## check conditioning? I tried $conditional and it doesnt seem to do what I
 	## intuitively expected. For now, I just check the dimensionality of the scores,
 	## as it will match the number of included "effects" on dimension 3 if uncond.
 	## estimation was used.
@@ -640,9 +640,20 @@
 						## Figure out the base values:
 						dvind <- which(names(data$cCovars) ==
 							effects$interaction1[effects$effectNumber==i])
-						## Stick them into the right time spot
-						base[,p] <- data$cCovars[[dvind]]
-						## make a new varCovar:
+						if ( length(dvind) == 0) {
+						## It is a varCovar, not a coCovar 
+							dvind <- which(names(data$vCovars) ==
+											effects$interaction1[effects$effectNumber==i])
+							if (length(dvind)==0) {
+								stop("Having trouble finding the covariate for your rate effect. Please
+									 contact the developers.")
+							}
+							base[,p] <- data$vCovars[[dvind]][,p]
+						} else {
+							## Stick them into the right time spot
+							base[,p] <- data$cCovars[[dvind]]
+							## make a new varCovar:
+						}
 						base <- varCovar(base)
 						base <- addAttributes.varCovar(base, name=dname)
 						data$vCovars[[length(data$vCovars)+1]] <- base



More information about the Rsiena-commits mailing list