Learn R Programming

RSiena (version 1.1-212)

includeTimeDummy: 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

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.

Details

The arguments should identify the effects completely. The include column will be set to the value requested (TRUE or FALSE)

References

See http://www.stats.ox.ac.uk/~snijders/siena/ for general information on RSiena.

See Also

sienaTimeTest, getEffects, siena07

Examples

Run this code
## 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.
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)

Run the code above in your browser using DataLab