[Rsiena-commits] r102 - in pkg/RSienaTest: . R doc man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jun 10 17:27:49 CEST 2010


Author: jalospinoso
Date: 2010-06-10 17:27:48 +0200 (Thu, 10 Jun 2010)
New Revision: 102

Removed:
   pkg/RSienaTest/man/includeTimeDummy.Rd
Modified:
   pkg/RSienaTest/NAMESPACE
   pkg/RSienaTest/R/sienaTimeTest.r
   pkg/RSienaTest/changeLog
   pkg/RSienaTest/doc/s_man400.tex
   pkg/RSienaTest/man/plot.sienaTimeTest.Rd
   pkg/RSienaTest/man/setEffect.Rd
   pkg/RSienaTest/man/sienaTimeTest.Rd
Log:
Removed includeTimeDummy

Modified: pkg/RSienaTest/NAMESPACE
===================================================================
--- pkg/RSienaTest/NAMESPACE	2010-06-09 19:50:02 UTC (rev 101)
+++ pkg/RSienaTest/NAMESPACE	2010-06-10 15:27:48 UTC (rev 102)
@@ -5,7 +5,7 @@
 sienaGroupCreate,  sienaModelCreate, sienaNet, sienaNodeSet, #simstats0c,
        varCovar, varDyadCovar, setEffect, includeEffects, includeInteraction,
        effectsDocumentation, sienaDataConstraint, #maxlikefn,
-       installGui, siena08, iwlsm, sienaTimeTest, includeTimeDummy)
+       installGui, siena08, iwlsm, sienaTimeTest)
 
 import(Matrix)
 import(xtable)

Modified: pkg/RSienaTest/R/sienaTimeTest.r
===================================================================
--- pkg/RSienaTest/R/sienaTimeTest.r	2010-06-09 19:50:02 UTC (rev 101)
+++ pkg/RSienaTest/R/sienaTimeTest.r	2010-06-10 15:27:48 UTC (rev 102)
@@ -760,40 +760,4 @@
 		}
 		list(effects=effects, data=data)
 	}
-}
-##@includeTimeDummy DataCreate
-includeTimeDummy <- function(myeff, ..., timeDummy="all", name=myeff$name[1],
-		type="eval", interaction1="", interaction2="", include=TRUE,
-		character=FALSE)
-{
-
-	if (character)
-	{
-		dots <- sapply(list(...), function(x)x)
-	}
-	else
-	{
-		dots <- substitute(list(...))[-1] ##first entry is the word 'list'
-	}
-	if (length(dots) == 0)
-	{
-		stop("need some effect short names")
-	}
-	if (!character)
-	{
-		effectNames <- sapply(dots, function(x)deparse(x))
-	}
-	else
-	{
-		effectNames <- dots
-	}
-	use <- myeff$shortName %in% effectNames &
-			myeff$type==type &
-			myeff$name==name &
-			myeff$interaction1 == interaction1 &
-			myeff$interaction2 == interaction2
-	myeff[use, "timeDummy"] <- timeDummy
-    myeff[use, "include"] <- include
-    print.data.frame(myeff[use,])
-	myeff
-}
+}
\ No newline at end of file

Modified: pkg/RSienaTest/changeLog
===================================================================
--- pkg/RSienaTest/changeLog	2010-06-09 19:50:02 UTC (rev 101)
+++ pkg/RSienaTest/changeLog	2010-06-10 15:27:48 UTC (rev 102)
@@ -1,3 +1,12 @@
+2010-06-08 R-forge revision 100/101
+
+	* R/sienaTimeTest.r: added changing covariate functionality to
+	sienaTimeFix for RateX effects. Deleted includeTimeDummy.
+	* man/includeTimeDummy.r: deleted.
+	* man/sienaTimeTest.r: changed includeTimeDummy to setEffects
+	* man/plot.sienaTimeTest.r: changed includeTimeDummy to setEffects
+	* doc/s_man400.tex: changed includeTimeDummy to setEffects
+
 2010-06-08 R-forge revision 99
 
 	* R/simstatsc.r: fixed bug that bipartite networks not allowed 'loops'

Modified: pkg/RSienaTest/doc/s_man400.tex
===================================================================
--- pkg/RSienaTest/doc/s_man400.tex	2010-06-09 19:50:02 UTC (rev 101)
+++ pkg/RSienaTest/doc/s_man400.tex	2010-06-10 15:27:48 UTC (rev 102)
@@ -1491,7 +1491,7 @@
 
 # Add a few time dummy terms:
 
-    myeff3<- includeTimeDummy(myeff2, recip, balance, timeDummy="2")
+    myeff3<- setEffect(myeff2, recip, balance, timeDummy="2")
 
 # And estimate the new model:
 
@@ -3756,7 +3756,7 @@
 with time dummies. You
 can include these in your model simply via the function
 \begin{verbatim}
-myeffects <- includeTimeDummy(myeffects, density, reciprocity, timeDummy="2,3,6")
+myeffects <- setEffect(myeffects, density, reciprocity, timeDummy="2,3,6")
 \end{verbatim}
 which would add three time dummy terms to each effect listed in the function.
 
@@ -4804,7 +4804,7 @@
 If as a consequence of this analysis you wish to add time dummy terms,
 this may be done via
 \begin{verbatim}
-myeff <- includeTimeDummy(myeff, recip, balance, timeDummy="2")
+myeff <- setEffect(myeff, recip, balance, timeDummy="2")
 ans3 <- siena07(mymodel, data=mydata, effects=myeff, batch=TRUE)
 \end{verbatim}
 and testing again,
@@ -7851,6 +7851,7 @@
 (Programmers should consult the changeLog file on CRAN or in the R-forge
 repository.)
 \begin{itemize}
+\item 2010-06-10 R-forge revision 100/101: Removed includeTimeDummy, as it duplicates functionality for setEffects. Fixed RateX so that it works with changing actor covariates as well.
 \item 2010-06-08 R-forge revision 99
 Fix to bug introduced in revision 98: bipartite networks could not have 'loops'
 \item 2010-06-08 R-forge revision 98

Deleted: pkg/RSienaTest/man/includeTimeDummy.Rd
===================================================================
--- pkg/RSienaTest/man/includeTimeDummy.Rd	2010-06-09 19:50:02 UTC (rev 101)
+++ pkg/RSienaTest/man/includeTimeDummy.Rd	2010-06-10 15:27:48 UTC (rev 102)
@@ -1,95 +0,0 @@
-\name{includeTimeDummy}
-\alias{includeTimeDummy}
-\title{Functions to include time dummy effects in a Siena model}
-\description{
-  This function provides an interface to set the TimeDummy column on
-  selected rows of a Siena effects object.
- }
-
-\usage{
-includeTimeDummy(myeff, ..., timeDummy="all", name=myeff$name[1],
-type="eval", interaction1="", interaction2="", include=TRUE,
-character=FALSE)
-}
-\arguments{
-  \item{myeff}{a Siena effects object as created by \code{\link{getEffects}}
-}
-  \item{\dots}{
-short names to identify the effects which should be included or excluded.
-}
-\item{timeDummy}{character string. Either "all" or the periods for which
-  to create dummies, space delimited.}
-  \item{include}{Boolean. default TRUE, but can be switched to FALSE to
-	turn off an effect.
-  }
-  \item{name}{Name of network for which effects are being
-	included. Defaults to the first in the effects object.
-}
-  \item{type}{
-  Type of effects to be included.
-}
-  \item{interaction1}{
-  Name of siena object where needed to completely identify the
-  effects e.g. covariate name or behavior variable name.
-}
-  \item{interaction2}{
-  Name of siena object where needed to completely identify the
-  effects e.g. covariate name or behavior variable name.
-}
-\item{character}{Boolean: are the effect names character strings or not}
-}
-\details{
-The arguments should identify the effects completely. The
-  include column will be set to the value requested (TRUE or FALSE)}
-\value{
-	An updated version of the input effects object, with the include
-	columns for one or more rows
-	updated.
-	Details of the rows altered will be printed.
-}
-
-\references{See \url{http://www.stats.ox.ac.uk/~snijders/siena/}
-  for general information on RSiena.
-
-}
-\author{Josh Lospinoso}
-\seealso{\code{\link{sienaTimeTest}}, \code{\link{getEffects}},
-  \code{\link{siena07}}}
-\examples{
-## Estimate a restricted model
-mymodel <- sienaModelCreate(fn=simstats0c, nsub=2, n3=100)
-mynet1 <- sienaNet(array(c(s501, s502, s503), dim=c(50, 50, 3)))
-mydata <- sienaDataCreate(mynet1)
-myeff <- getEffects(mydata)
-myeff <- includeEffects(myeff, transTrip, balance)
-ans <- siena07(mymodel, data=mydata, effects=myeff, batch=TRUE)
-
-## Conduct the score type test to assess whether heterogeneity is present.
-tt <- sienaTimeTest(ans)
-
-## Suppose that we wish to include two time dummies.
-## Add them in the following way:
-myeff <- includeTimeDummy(myeff, recip, balance, timeDummy="2")
-ans2 <- siena07(mymodel, data=mydata, effects=myeff, batch=TRUE)
-
-## Re-assess the time heterogeneity
-tt2 <- sienaTimeTest(ans2)
-
-## And so on..
-
-## A demonstration of RateX heterogeneity. Note that rate
-## interactions are not implemented in general, just for
-## Rate x cCovar.
-\dontrun{
-mymodel <- sienaModelCreate(fn=simstats0c, nsub=2, n3=100)
-mynet1 <- sienaNet(array(c(s501, s502, s503), dim=c(50, 50, 3)))
-myccov <- coCovar(s50a[,1])
-mydata <- sienaDataCreate(mynet1, myccov)
-myeff <- getEffects(mydata)
-myeff <- includeEffects(myeff, transTrip, balance)
-myeff <- includeTimeDummy(myeff, RateX, type="rate",
-			interaction1="myccov")
-ans <- siena07(mymodel, data=mydata, effects=myeff, batch=TRUE)
-}
-}
-\keyword{models}

Modified: pkg/RSienaTest/man/plot.sienaTimeTest.Rd
===================================================================
--- pkg/RSienaTest/man/plot.sienaTimeTest.Rd	2010-06-09 19:50:02 UTC (rev 101)
+++ pkg/RSienaTest/man/plot.sienaTimeTest.Rd	2010-06-10 15:27:48 UTC (rev 102)
@@ -73,9 +73,9 @@
 mydata <- sienaDataCreate(mynet1)
 myeff <- getEffects(mydata)
 myeff <- includeEffects(myeff, transTrip, balance)
-myeff <- includeTimeDummy(myeff, recip, timeDummy="2,3,5")
-myeff <- includeTimeDummy(myeff, balance, timeDummy="4")
-myeff <- includeTimeDummy(myeff, density, timeDummy="all")
+myeff <- setEffect(myeff, recip, timeDummy="2,3,5")
+myeff <- setEffect(myeff, balance, timeDummy="4")
+myeff <- setEffect(myeff, density, timeDummy="all")
 ansp <- siena07(mymodel, data=mydata, effects=myeff, batch=FALSE)
 ttp <- sienaTimeTest(ansp)
 

Modified: pkg/RSienaTest/man/setEffect.Rd
===================================================================
--- pkg/RSienaTest/man/setEffect.Rd	2010-06-09 19:50:02 UTC (rev 101)
+++ pkg/RSienaTest/man/setEffect.Rd	2010-06-10 15:27:48 UTC (rev 102)
@@ -29,7 +29,7 @@
   \item{initialValue}{Initial value required. Default 0.
 }
 \item{timeDummy}{string: Comma delimited string of which periods to
-dummy. Alternately, use \code{\link{includeTimeDummy}}.
+dummy. Alternately, use the corresponding column on your effect object}.
 }
   \item{include}{Boolean. default TRUE, but can be switched to FALSE to
 	turn off an effect.}

Modified: pkg/RSienaTest/man/sienaTimeTest.Rd
===================================================================
--- pkg/RSienaTest/man/sienaTimeTest.Rd	2010-06-09 19:50:02 UTC (rev 101)
+++ pkg/RSienaTest/man/sienaTimeTest.Rd	2010-06-10 15:27:48 UTC (rev 102)
@@ -45,7 +45,7 @@
  time periods or effects (or any combination therein), the
  \code{timeDummy} column provides facilities within a sienaFit object to
  quickly adjust the model and re-estimate in the usual way. Alternately,
- the includeTimeDummy function can be used to add the desired dummies.
+ the setEffect function can be used to add the desired dummies.
 }
 \value{
   \code{sienaTimeTest} Returns a list containing many items,
@@ -76,7 +76,7 @@
 }
 \author{Josh Lospinoso}
 \seealso{\code{\link{siena07}}, \code{\link{plot.sienaTimeTest}},
-  \code{\link{includeTimeDummy}}}
+  \code{\link{setEffect}}}
 \examples{
 ## Estimate a restricted model
 mymodel <- sienaModelCreate(fn=simstats0c, nsub=2, n3=100)
@@ -91,7 +91,7 @@
 
 ## Suppose that we wish to include two time dummies.
 ## Add them in the following way:
-myeff <- includeTimeDummy(myeff, recip, balance, timeDummy="2")
+myeff <- setEffect(myeff, recip, balance, timeDummy="2")
 ans2 <- siena07(mymodel, data=mydata, effects=myeff, batch=TRUE)
 
 ## Re-assess the time heterogeneity
@@ -106,9 +106,9 @@
 mydata <- sienaDataCreate(mynet1)
 myeff <- getEffects(mydata)
 myeff <- includeEffects(myeff, transTrip, balance)
-myeff <- includeTimeDummy(myeff, recip, timeDummy="2,3,5")
-myeff <- includeTimeDummy(myeff, balance, timeDummy="4")
-myeff <- includeTimeDummy(myeff, density, timeDummy="all")
+myeff <- setEffect(myeff, recip, timeDummy="2,3,5")
+myeff <- setEffect(myeff, balance, timeDummy="4")
+myeff <- setEffect(myeff, density, timeDummy="all")
 ansp <- siena07(mymodel, data=mydata, effects=myeff, batch=FALSE)
 ttp <- sienaTimeTest(ansp)
 
@@ -128,8 +128,8 @@
 mydata <- sienaDataCreate(mynet1, myccov)
 myeff <- getEffects(mydata)
 myeff <- includeEffects(myeff, transTrip, balance)
-myeff <- includeTimeDummy(myeff, RateX, type="rate",
-			interaction1="myccov")
+myeff <- setEffect(myeff, RateX, type="rate",
+			interaction1="myccov", timeDummy="all")
 ans <- siena07(mymodel, data=mydata, effects=myeff, batch=TRUE)
 }
 }



More information about the Rsiena-commits mailing list