includeEffects: Function to include effects in a Siena model

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/sienaeffects.r

Description

This function can be used for model specification by modifying a Siena effects object.

Usage

1
2
3
includeEffects(myeff, ..., include = TRUE, name = myeff$name[1], type = "eval",
 interaction1 = "", interaction2 = "", fix=FALSE, test=FALSE, character=FALSE,
 verbose = TRUE)

Arguments

myeff

a Siena effects object as created by getEffects

...

short names to identify the effects which should be included or excluded.

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

Type of effects to be included: "eval", "endow", "creation", or "rate".

interaction1

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

interaction2

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

fix

Boolean. Are the effects to be fixed at the value stored in myeff$initialValue or not.

test

Boolean. Are the effects to be tested or not (requires fix).

character

Boolean: are the effect names character strings or not.

verbose

Boolean: should the print of altered effects be produced.

Details

The effects indicated by the arguments ..., type, and (if necessary) interaction1 and interaction2 are included or excluded from the model specified by the effects object. The names interaction1 and interaction2 do not refer to interactions between effects, but to dependence of effects on other variables in the data set. The arguments should identify the effects completely.
The short names must not be set between quotes, unless you use character=TRUE.

The function includeEffects operates as an interface setting the "include" column on selected rows of the effects object, to the value requested (TRUE or FALSE).

The function setEffect can operate on the effects object in a more detailed way, e.g., setting the value of myeff$initialValue, but applies to one effect at the time.

Further information about Siena effects objects is given in the help page for getEffects.

A list of all effects available in a given effects object (e.g., myeff), including their names of dependent variables, effect names, short names, and values of interaction1 and interaction2 (if any), is obtained by executing effectsDocumentation(myeff).

Value

An updated version of the input effects object, with the include, test, and fix columns for one or more rows updated. Details of the rows altered will be printed.

Author(s)

Ruth Ripley

References

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

See Also

getEffects, setEffect, includeInteraction, updateSpecification, print.sienaEffects, effectsDocumentation

Examples

1
2
3
4
5
6
7
mynet1 <- sienaDependent(array(c(s501, s502, s503), dim=c(50, 50, 3)))
mybeh  <- sienaDependent(s50a, type="behavior")
mydata <- sienaDataCreate(mynet1, mybeh)
myeff <- getEffects(mydata)
myeff <- includeEffects(myeff, transTrip, balance)
myeff <- includeEffects(myeff, avAlt, name="mybeh", interaction1="mynet1")
myeff

Example output

Warning message:
no DISPLAY variable so Tk is not available 
  effectName          include fix   test  initialValue parm
1 transitive triplets TRUE    FALSE FALSE          0   0   
2 balance             TRUE    FALSE FALSE          0   0   
  effectName          include fix   test  initialValue parm
1 mybeh average alter TRUE    FALSE FALSE          0   0   
   name   effectName                      include fix   test  initialValue parm
1  mynet1 constant mynet1 rate (period 1) TRUE    FALSE FALSE    4.69604   0   
2  mynet1 constant mynet1 rate (period 2) TRUE    FALSE FALSE    4.32885   0   
3  mynet1 outdegree (density)             TRUE    FALSE FALSE   -1.46770   0   
4  mynet1 reciprocity                     TRUE    FALSE FALSE    0.00000   0   
5  mynet1 transitive triplets             TRUE    FALSE FALSE    0.00000   0   
6  mynet1 balance                         TRUE    FALSE FALSE    0.00000   0   
7  mybeh  rate mybeh (period 1)           TRUE    FALSE FALSE    0.70571   0   
8  mybeh  rate mybeh (period 2)           TRUE    FALSE FALSE    0.84939   0   
9  mybeh  mybeh linear shape              TRUE    FALSE FALSE    0.32237   0   
10 mybeh  mybeh quadratic shape           TRUE    FALSE FALSE    0.00000   0   
11 mybeh  mybeh average alter             TRUE    FALSE FALSE    0.00000   0   

RSiena documentation built on Sept. 24, 2020, 3 p.m.