Learn R Programming

RSiena (version 1.5.0)

updateTheta: A function to update the initial values of theta, and a function to update an effects object.

Description

updateTheta copies the final values of any matching selected effects from a sienaFit object to a Siena effects object.
updateSpecification includes in a Siena effects object a set of effects that are included in another effects object.

Usage

updateTheta(effects, prevAns, varName=NULL)
updateSpecification(effects.to, effects.from,
                          effects.extra=NULL, name.to=NULL, name.from=NULL)

Value

Updated effects object.

Arguments

effects

Object of class sienaEffects.

prevAns

Object of class sienaFit as returned by siena07.

varName

Character string or vector of character strings; is this is not NULL, the update will only applied to this dependent variable / these dependent variables.

effects.to

Object of class sienaEffects.

effects.from

Object of class sienaEffects.

effects.extra

Object of class sienaEffects.

name.to

Character string, name of dependent variable in object.to.

name.from

Character string, name of dependent variable in object.from.

Author

Ruth Ripley, Tom A.B. Snijders

Details

The initial values of any selected effects in the input effects object which match an effect estimated in prevAns will be updated by updateTheta. If the previous run was conditional, the estimated rate parameters for the dependent variable on which the run was conditioned are added to the final value of theta. If varName is not NULL, this update is restricted to effects for the dependent variable/s specified by varName.
By updateSpecification, the effects included in effects.from are also included in effects.to; if name.to and/or name.from is specified, this is restricted to effects for those dependent variables.
If effects.from contains interaction effects, the corresponding main effects will be looked for in effects.from; if they are not found there, they will be looked for in effects.extra. It is not guaranteed that this will be successful. For effects.extra, it is best to use an effects object constructed for the same data set as effects.from, and by the same version of RSiena.

References

See https://www.stats.ox.ac.uk/~snijders/siena/

See Also

siena07, getEffects

Examples

Run this code
## For updateTheta:
mynet1 <- sienaDependent(array(c(tmp3, tmp4), dim=c(32, 32, 2)))
mydata <- sienaDataCreate(mynet1)
myeff1 <- getEffects(mydata)
myeff1 <- includeEffects(myeff1, transTrip)
myeff1 <- includeInteraction(myeff1, recip, inPop)
myalgorithm <- sienaAlgorithmCreate(nsub=1, n3=100, projname=NULL)
ans <- siena07(myalgorithm, data=mydata, effects=myeff1, batch=TRUE)
ans$theta
(myeff <- updateTheta(myeff1, ans))
##
## For updateSpecification:
myeff2 <- getEffects(mydata)
myeff2 <- includeEffects(myeff2, outAct)
updateSpecification(myeff2, myeff1)

Run the code above in your browser using DataLab