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

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

View source: R/sienaeffects.r

Description

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

Usage

1
2
3
4
5
setEffect(myeff, shortName, parameter = NULL, fix = FALSE,
test = FALSE, random=FALSE, initialValue = 0, timeDummy = ",", include = TRUE,
name = myeff$name[1], type = "eval", interaction1 = "",
interaction2 = "", effect1=0, effect2=0, effect3=0,
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

Value of internal effect parameter. If NULL, no change is made.

fix

For fixing effects. Boolean required. Default FALSE.

test

For testing effects by score-type tests. Boolean required. Default FALSE.

random

For specifying that effects will vary randomly; not relevant for RSiena at this moment. 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 dependent variable (network or behavior) for which effects are being modified. 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.

effect1

Only for shortName=unspInt, which means this is a user-defined interaction effect: effect1 is a natural number indicating the first component of the interaction effect; the number is the one listed when applying print() to myeff.

effect2

Only for shortName=unspInt: second component of interaction effect (see effect1).

effect3

Only for shortName=unspInt: third component of interaction effect, if any (see effect1).

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.

Details

The arguments shortName, name, type, interaction1, interaction2, effect1, effect2, and effect3 should identify the effects completely. The column elements of the output effects object for parm, fix, test, randomEffects, initialValue, and timeDummy will be set to the values requested.

Value

An object of class sienaEffects or sienaGroupEffects. This will be an updated version of the input effects object, with one row updated. Details of the row altered will be printed.

Author(s)

Ruth Ripley

References

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

See Also

getEffects, includeEffects, includeInteraction.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
mynet <- sienaDependent(array(c(s501, s502, s503), dim=c(50, 50, 3)))
mybeh <- sienaDependent(s50a, type="behavior")
mydata <- sienaDataCreate(mynet, mybeh)
myeff <- getEffects(mydata)
# Set the initial rate parameter for one period:
myeff <- setEffect(myeff, Rate, initialValue=1.5, name="mybeh",
                   type="rate", period=2)
# Specify an effect parameter:
myeff <- setEffect(myeff, outTrunc, parameter=1)
myeff
# Now request the interaction between reciprocity and alcohol similarity
# to be tested without estimation.
myeff <- includeInteraction(myeff, recip, simX, interaction1=c("", "mybeh"))
myeff
# The following code uses the fact that the interaction effect is number 6.
# In practice one would just look up the numbers of effect1 and effect2
# from the response to \code{myeff} and fill them in.
(eff1 <- myeff[myeff$include,]$effect1[6])
(eff2 <- myeff[myeff$include,]$effect2[6])
myeff <- setEffect(myeff, unspInt, fix=TRUE, test=TRUE,
                                    effect1=eff1, effect2=eff2)
myeff

RSiena documentation built on May 13, 2018, 5:03 p.m.