This function provides an interface to change various columns of a selected row of a Siena effects object.
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, verbose = TRUE)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, unless verbose=FALSE.
a Siena effects object as created by getEffects
A short name (all with or all without quotes) to identify the effect which should be changed.
Value of internal effect parameter. If NULL,
no change is made.
For fixing effects. Boolean required. Default FALSE.
For testing effects by score-type tests. Boolean required.
Default FALSE.
For specifying that effects will vary randomly;
used only in function sienaBayes in package multiSiena.
Not relevant for RSiena at this moment.
Boolean required. Default FALSE.
Initial value for estimation. Default 0.
string: Comma delimited string of which periods to
dummy. Alternatively, use includeTimeDummy.
Boolean. default TRUE, but can be switched to
FALSE to turn off an effect.
Name of dependent variable (network or behavior)
for which the effect is being modified.
Defaults to the first in the effects object, which is the
first dependent variable specified in sienaDataCreate.
Character string indicating the type of the effect to be changed : "rate", "eval", "endow", or "creation". Default "eval".
Name of siena object where needed to completely identify the effect e.g. covariate name or behavior variable name.
Name of siena object where needed to completely identify the effect e.g. covariate name or behavior variable name.
Only for shortName=unspInt, behUnspInt or contUnspInt,
which means this is a user-defined interaction effect: effect1 is
the row number in myeff of the first component of
the interaction effect.
See effect1: second component of interaction effect.
See effect1: third component of interaction effect.
Number of period if basic rate. Use numbering within groups.
Number of group if basic rate.
Only relevant for sienaGroup data sets.
Boolean: whether the short name is a character string.
Boolean: should the print of altered effects be produced.
Ruth Ripley, Tom Snijders
Recall from the help page for getEffects
that a Siena effects object (class sienaEffects or
sienaGroupEffects) is a data.frame;
the rows in the data frame are the effects for this data set;
some of the columns/variables of the data frame
are used to identify the effect, other columns/variables define how this
effect is used in the estimation.
The function includeEffects can operate on several
effects simultaneously, but in a less detailed way.
The main use of setEffect is that it can change not only the
value of the column include, but also
those of initialValue and parm.
The arguments shortName, name, type,
interaction1, interaction2, effect1, effect2,
effect3, period, and group should identify one
effect completely. (Not all of them are needed;
see getEffects.)
The call of setEffect will set, for this effect,
the column elements of the resulting effects object for parm,
fix, test, randomEffects, initialValue,
timeDummy, and include to the values requested.
The shortName must not be set between quotes,
unless you use character=TRUE.
The input names interaction1 and interaction2 do not themselves
refer to created interactions, but to dependence of the base effects on
other variables in the data set.
They are used to completely identify the effects.
If a value for parameter is given,
the occurrences of # in the original effect and function names
are replaced by this value. If a value for parameter is not given,
the default value of the internal effect parameter of this effect is used.
getEffects, includeEffects,
includeInteraction, includeGMoMStatistics,
updateSpecification,
print.sienaEffects, effectsDocumentation.
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, gwespFF)
# Specify an effect parameter:
myeff <- setEffect(myeff, outTrunc, parameter=1)
myeff
# Set the initial rate parameter for one period:
myeff <- setEffect(myeff, Rate, initialValue=1.5, name="mybeh",
type="rate", period=2)
myeff
Run the code above in your browser using DataLab