Learn R Programming

RSiena (version 1.1-232)

setEffect: Function to set various columns in an effects object in a Siena model

Description

This function provides an interface to change various columns of a selected row of a Siena effects object

Usage

setEffect(myeff, shortName, parameter = 0, fix = FALSE,
test = FALSE, initialValue = 0, timeDummy = ",", include = TRUE,
name = myeff$name[1], type = "eval", interaction1 = "",
interaction2 = "", period=1, group=1, character=FALSE)

Arguments

myeff

a Siena effects object as created by getEffects

shortName

A short name (all with or all without quotes) to identify the effect which should be changed.

parameter

Integer value required. Default 0.

fix

Boolean required. Default FALSE.

test

Boolean required. Default FALSE.

initialValue

Initial value required. Default 0.

timeDummy

string: Comma delimited string of which periods to dummy. Alternatively, use includeTimeDummy.

include

Boolean. default TRUE, but can be switched to FALSE to turn off an effect.

name

Name of network for which effects are being included. Defaults to the first in the effects object.

type

Character string indicating the type of the effect to be changed : currently "rate", "eval", "endow", or "creation". Default "eval".

interaction1

Name of siena object where needed to completely identify the effect e.g. covariate name or behavior variable name.

interaction2

Name of siena object where needed to completely identify the effect e.g. covariate name or behavior variable name.

period

Number of period if basic rate. Use numbering within groups.

group

Number of group if basic rate.

character

Boolean: is the short name a character string or not

Value

An updated version of the input effects object, with one row updated. Details of the row altered will be printed.

Details

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

References

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

See Also

getEffects

Examples

Run this code
# NOT RUN {
mynet <- sienaDependent(array(c(s501, s502, s503), dim=c(50, 50, 3)))
mybeh <- sienaDependent(s50a, type="behavior")
mydata <- sienaDataCreate(mynet, mybeh)
myeff <- getEffects(mydata)
myeff <- setEffect(myeff, Rate, initialValue=1.5, name="mybeh",
                   type="rate", period=2)
myeff <- setEffect(myeff, outInv, 3) ## parameter
myeff
# }

Run the code above in your browser using DataLab