sienaRIDynamics: Functions to assess the dynamics of relative importance of...

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

View source: R/sienaRIDynamics.r

Description

The function sienaRIDynamics returns the relative importance of effects in a SAOM according to the measure of relative importance described in Indlekofer and Brandes (2013). More precisely, it returns aggregates of relative importances over simulated micro-steps between observation moments as described in Section 3.2 of this paper. The measure is based on the influence of effects on simulated micro-steps and takes the complete model specification into account. Therefore, required arguments are the analysed data given as a siena data object (necessary for the micro-steps simulations) as well as the complete model specification represented either by an estimated sienaFit object or by the triple consisting of a suitable parameter vector theta and the corresponding sienaAlgorithm and sienaEffects objects.

Usage

1
2
3
4
5
6
  sienaRIDynamics(data, ans=NULL, theta=NULL, algorithm=NULL, effects=NULL,
     depvar=NULL, intervalsPerPeriod=NULL)
  ## S3 method for class 'sienaRIDynamics'
plot(x, staticRI=NULL, col=NULL,
     ylim=NULL, width=NULL, height=NULL, legend=TRUE, legendColumns=NULL,
     legendHeight=NULL, cex.legend=NULL, ...)

Arguments

data

siena data object representing the analyzed data and resulting from a call to sienaDataCreate.

ans

sienaFit object resulting from a call to siena07. The sienaFit object contains all necessary information on the model specification, in particular, the vector of parameter values ans$theta, the used algorithm for estimation ans$x, and information on included model effects ans$effects. If ans is a valid sienaFit object, the calculations of relative importances are based on ans$theta, ans$x, and ans$effects. Alternatively, the necessary information can be given directly as a suitable parameter vector theta, a sienaAlgorithm object, and a sienaEffects object. In this case, ans has to be unspecified (i.e., ans=NULL).

theta

Vector of parameter values of effects included in the model. Length of theta has to be equal to the number of included effects (rate effects as well as evaluation effects).

algorithm

sienaAlgorithm object as resulting from a call to sienaAlgorithmCreate. Works only for estimation by Method of Moments (i.e., if maxlike = FALSE).

effects

sienaEffects object specifying which effects are included the model.

depvar

If the model contains more than one dependent variable, it has to be specified for which dependent variable the relative importances of associated effects should be determined. Only those simulated micro-steps that refer to the selected dependent variable are considered in the aggregated values of relative importance of the corresponding effects. If depvar=NULL, relative importances will be determined for the first element in the list of dependent variables of data (attr(data$depvars,"names")[1]).

intervalsPerPeriod

For analyzing the dynamics of relative importances between observation moments, the time interval between observation moments is divided into intervalsPerPeriod subintervals. The values of relative importance are aggregated over all micro-steps of one subinterval. Default value is 10 subintervals per period.

x

sienaRIDynamics object resulting from a call to sienaRIDynamics.

staticRI

sienaRI object corresponding to the same model and data as x. If staticRI is specified, the expected relative importances of effects at observation moment are indicated in the plot by circlets at the beginning of each period.

col

Colors used in the plot. If col=NULL a default color scheme is used.

ylim

A vector of two numbers specifying the maximum and minimum value of the y-range visible in the plot. If ylim=NULL default values are used.

width

Width of the plot. If width=NULL a default value is used.

height

Height of the plot. If height=NULL a default value is used.

legend

Boolean: if TRUE a legend is added to the plot. x$effectNames are used as labels.

legendColumns

Number of columns in legend. If legendColumns=NULL a default value is used. Only effective if legend=TRUE.

legendHeight

Height of legend. If legendHeight=NULL a default value is used. Only effective if legend=TRUE.

cex.legend

Specifies the relative font size of legend labels.

...

Other arguments.

Details

Currently there still is an error in this function.
sienaRIDynamics takes the data as well as the complete model specification into account. Therefore, necessary arguments are the analyzed data given as a siena data object as well as the complete model specification represented either by an estimated sienaFit object or by the triple consisting of a suitable parameter vector theta and the corresponding sienaAlgorithm and sienaEffects objects.

Note that sienaRIDynamics works only with Method of Moments (i.e., for sienaAlgorithm objects with maxlike = FALSE).

If ans is a valid sienaFit object that resulted from a call to siena07 with unconditional estimation (i.e., for sienaAlgorithm objects with cond = FALSE), the calculations of relative importances are based on ans$theta, ans$x, and ans$effects. (Note that if the estimation of ans has been conditional on a dependent variable, it is necessary to give the associated sienaEffects object explicitly to sienaRIDynamics).

Alternatively, the necessary information can be given directly as a suitable parameter vector theta (containing necessary rate and evaluation parameters), a sienaAlgorithm object, and a sienaEffects object. In this case, ans has to be unspecified, i.e., ans=NULL.

Value

sienaRIDynamics returns an object of class sienaRIDynamics.

A returned sienaRIDynamics object stores the relative importances of effects in simulated micro-steps aggregated to intervalsPerPeriod averages per period. For details, see Section 3.2 of Indlekofer and Brandes (2013).

A sienaRIDynamics object consists of following components:

- intervalValues

the relative importances of included effects for simulated micro-steps of the considered dependent variable aggregated over subintervals.

- dependentVariable

the name of the dependent variable the results refer to.

- effectNames

the names of considered effects.

Author(s)

Natalie Indlekofer

References

Indlekofer, N. and Brandes, U., “Relative Importance of Effects in Stochastic Actor-oriented Models.” Network Science, 1 (3), 2013.

See Also

sienaRI

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
myalgorithm <- sienaAlgorithmCreate(nsub=2, n3=50, cond=FALSE)
mynet1 <- sienaDependent(array(c(tmp3, tmp4), dim=c(32, 32, 2)))
mydata <- sienaDataCreate(mynet1)
myeff <- getEffects(mydata)
myeff <- includeEffects(myeff, density, recip, transTies, nbrDist2)
ans <- siena07(myalgorithm, data=mydata, effects=myeff, batch=TRUE)

## Not run: 
RIDynamics1 <- sienaRIDynamics(mydata, ans=ans)
RIDynamics1
plot(RIDynamics1)

## End(Not run)

## Not run: 
myalgorithm2 <- sienaAlgorithmCreate(nsub=2, n3=50, cond=TRUE)
ans2 <- siena07(myalgorithm2, data=mydata, effects=myeff, batch=TRUE)

RIDynamics2 <- sienaRIDynamics(mydata, ans=ans2, effects=myeff)
RIDynamics2

RIDynamics3 <- sienaRIDynamics(data=mydata, theta=c(ans2$rate,ans2$theta),
             algorithm=myalgorithm2, effects=myeff, intervalsPerPeriod=4)
RIDynamics3

## End(Not run)

## Not run: 
myalgorithm3 <- sienaAlgorithmCreate(nsub=2, n3=50)
mynet2 <- sienaDependent(array(c(s501, s502, s503), dim=c(50, 50, 3)))
mybeh <- sienaDependent(s50a, type="behavior")
mydata2 <- sienaDataCreate(mynet2, mybeh)
myeff2 <- getEffects(mydata2)
myeff2 <- includeEffects(myeff2, density, recip, transTies, transTrip, nbrDist2)
ans3 <- siena07(myalgorithm3, data=mydata2, effects=myeff2, batch=TRUE)

RIDynamics4 <- sienaRIDynamics(mydata2, ans=ans3, depvar="mybeh")
RIDynamics4

RIDynamics5 <- sienaRIDynamics(mydata2, ans=ans3, depvar="mynet2")
RIDynamics5

## End(Not run)

## Not run: 
RI5 <- sienaRI(mydata2, ans=ans3)
plot(RIDynamics5, staticRI=RI5[[1]])

## End(Not run)

RSienaTest documentation built on July 14, 2021, 3 a.m.