Social Network Analysis#

RSiena#

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

SIENA is designed for analyzing various types of data as dependent variables:

  • Longitudinal network data: This refers to repeated measures of networks on a given node set (although it is allowed that there are some changes in the node set). Models can be specified with actor-oriented as well as tie-oriented dynamics; but mainly the former.

  • Longitudinal data of networks and behavior: This is like longitudinal network data, but in addition there are one or more changing nodal variables that are also treated as dependent variables, and referred to as behavior. The network will influence the dynamics of the behavior, and the behavior will influence the dynamics of the network. In other words, this is about the co-evolution of networks and behavior.

  • Cross-sectional network data. ‘Cross-sectional’ means that only one observation is available. This method uses exponential random graph models (‘ERGMs’), also called p* models. The ERG model is implemented in SIENA version 3, but not any more in version 4 (RSiena). It is still available, but no longer maintained.

The name SIENA stands for Simulation Investigation for Empirical Network Analysis. The method is implemented in the R package RSiena, and the more experimental version RSienaTest.

RSiena Manual http://www.stats.ox.ac.uk/~snijders/siena/RSiena_Manual.pdf

RSiena Github snlab-nl/rsiena

Install Rsiena#

Open Rstudio and Run the following script:

install.packages('remotes')
remotes::install_github("snlab-nl/rsiena")
library(RSiena)

RSiena Tutorials#

  • Snijders, T. A. B., van de Bunt, G. G., and Steglich, C. (2010b). Introduction to actorbased models for network dynamics. Social Networks, 32:44–60.

  • Snijders, T. A. B. (2017). Stochastic actor-oriented models for network dynamics. Annual Review of Statistics and Its Application, 4:343–363.

RSiena scripts#

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

The following scripts on the RSiena website go through the steps outlined in the previous section, providing additional details and options:

  • basicRSiena.r: a minimal example of a basic sequence of commands for estimating a model by function siena07() of RSiena.

  • Rscript01DataFormat.R: gives a brief overview of R functions and data formats that are essential for using RSiena.

  • Rscript02SienaVariableFormat.R: shows how to prepare data for a SIENA analysis, including the creation of RSiena objects; and how to specify effects for RSiena models.

  • Rscript03SienaRunModel.R: shows how to carry out the estimation and look at the results;

  • Rscript04SienaBehaviour.R: illustrates how to specify models for dynamics of networks and behaviour.

The website contains a lot of other scripts illustrating other functionalities of RSiena.

basicRSiena.r#

a basic script for the introduction to RSiena

version: August 8, 2020

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

?RSiena
# Now we use the internally available s50 data set.
# Look at its description:
# 3 waves, 50 actors
?s50
head(s501)
A matrix: 6 × 50 of type int
V1V2V3V4V5V6V7V8V9V10V41V42V43V44V45V46V47V48V49V50
00000000000000000000
00000010000000000000
00010000100000000000
00100000100000000000
00000000000000000000
00000001000000000000
tail(s501)
A matrix: 6 × 50 of type int
V1V2V3V4V5V6V7V8V9V10V41V42V43V44V45V46V47V48V49V50
4500000000000000011000
4600000000000000100010
4700000000000000000000
4800000000000000010010
4900000000000000010100
5000000000000000000000
# and at the alcohol variable
head(s50a)
A matrix: 6 × 3 of type int
V1V2V3
313
222
233
232
334
444
# Now define the objects with the same names as above
# (this step is superfluous if you read the data already).
friend.data.w1 <- s501
friend.data.w2 <- s502
friend.data.w3 <- s503
drink <- s50a
smoke <- s50s
# Now the data must be given the specific roles of variables
# in an RSiena analysis.
#
# Dependent variable

?sienaDependent
# First create a 50 * 50 * 3 array composed of the 3 adjacency matrices
friendshipData <- array( c( friend.data.w1, friend.data.w2, friend.data.w3 ),
           dim = c( 50, 50, 3 ) )

# and next give this the role of the dependent variable:

friendship <- sienaDependent(friendshipData)
# What did we construct?
friendship
Type         oneMode             
Observations 3                   
Nodeset      Actors (50 elements)
# We also must prepare the objects that will be the explanatory variables.
#
# Actor covariates
# We use smoking for wave 1 as a constant actor covariate:
smoke1 <- coCovar( smoke[ , 1 ] )
# A variable actor covariate is defined for drinking:
alcohol <- varCovar( drink )
# (This choice is purely for the purpose of illustration here.)
# Put the variables together in the data set for analysis
?sienaDataCreate
mydata <- sienaDataCreate( friendship, smoke1, alcohol )
# Check what we have
mydata
Dependent variables:  friendship 
Number of observations: 3 

Nodeset                  Actors 
Number of nodes              50 

Dependent variable friendship      
Type               oneMode         
Observations       3               
Nodeset            Actors          
Densities          0.046 0.047 0.05

Constant covariates:  smoke1 
Changing covariates:  alcohol 
# You can get an outline of the data set with some basic descriptives from
print01Report( mydata, modelname="./data/s50_RSiena_output")
# For the model specification we need to create the effects object
myeff <- getEffects( mydata )
# All the effects that are available given the structure
# of this data set can be seen from
effectsDocumentation(myeff)
?effectsDocumentation
# For a precise description of all effects, see Chapter 12 in the RSiena manual.
# A basic specification of the structural effects:
?includeEffects
myeff <- includeEffects( myeff, transTrip, cycle3)
# and some covariate effects:
myeff <- includeEffects( myeff, egoX, altX, simX, interaction1 = "alcohol" )
myeff <- includeEffects( myeff, simX, interaction1 = "smoke1" )
myeff
  effectName          include fix   test  initialValue parm
1 transitive triplets TRUE    FALSE FALSE          0   0   
2 3-cycles            TRUE    FALSE FALSE          0   0   
  effectName         include fix   test  initialValue parm
1 alcohol alter      TRUE    FALSE FALSE          0   0   
2 alcohol ego        TRUE    FALSE FALSE          0   0   
3 alcohol similarity TRUE    FALSE FALSE          0   0   
  effectName        include fix   test  initialValue parm
1 smoke1 similarity TRUE    FALSE FALSE          0   0   
A sienaEffects: 520 × 31
nameeffectNamefunctionNameshortNameinteraction1interaction2typebasicRateincluderandomEffectseffect3interactionTypelocalsettingeffectFnstatisticFnnetTypegroupNamegroupeffectNumber
<chr><chr><chr><chr><chr><chr><chr><lgl><lgl><lgl><int><chr><lgl><chr><list><list><chr><chr><dbl><int>
friendship.rate.1friendshipconstant friendship rate (period 1) Amount of network change in period 1 Rate rate TRUE TRUEFALSE0 TRUENULLNULLoneModeGroup11 1
friendship.rate.2friendshipconstant friendship rate (period 2) Amount of network change in period 2 Rate rate TRUE TRUEFALSE0 TRUENULLNULLoneModeGroup11 2
friendship.rate.3friendshipoutdegree effect on rate friendship Amount of change x outdegrees outRate rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 3
friendship.rate.4friendshipindegree effect on rate friendship Amount of change x indegrees inRate rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 4
friendship.rate.5friendshipreciprocity effect on rate friendship Amount of change x reciprocity recipRate rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 5
friendship.rate.6friendshipeffect 1/outdegree on rate friendship Amount of change x (1/outdegrees) outRateInv rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 6
friendship.rate.7friendshipeffect ln(outdegree+1) on rate friendshipAmount of change x ln(outdegrees+1) outRateLog rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 7
friendship.rate.8friendshipeffect smoke1 on rate Amount of change x smoke1 RateX smoke1 rate FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11 8
friendship.rate.9friendshipeffect alcohol on rate Amount of change x alcohol RateX alcoholrate FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11 9
friendship.obj.eval.1friendshipoutdegree (density) Number of ties density eval FALSE TRUE TRUE0dyadic TRUENULLNULLoneModeGroup1110
friendship.obj.endow.1friendshipoutdegree (density) Lost ties: Number of ties density endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1111
friendship.obj.creation.1friendshipoutdegree (density) New ties: Number of ties density creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1112
friendship.obj.eval.2friendshipreciprocity Number of reciprocated ties recip eval FALSE TRUEFALSE0dyadic TRUENULLNULLoneModeGroup1113
friendship.obj.endow.2friendshipreciprocity Lost ties: Number of reciprocated ties recip endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1114
friendship.obj.creation.2friendshipreciprocity New ties: Number of reciprocated ties recip creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1115
friendship.obj.eval.3friendshiptransitive triplets Number of transitive triplets transTrip eval FALSE TRUEFALSE0 TRUENULLNULLoneModeGroup1116
friendship.obj.endow.3friendshiptransitive triplets Lost ties: Number of transitive triplets transTrip endow FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1117
friendship.obj.creation.3friendshiptransitive triplets New ties: Number of transitive triplets transTrip creationFALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1118
friendship.obj.eval.4friendshiptransitive triplets (1) Number of transitive triplets transTrip1 eval FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1119
friendship.obj.endow.4friendshiptransitive triplets (1) Lost ties: Number of transitive triplets transTrip1 endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1120
friendship.obj.creation.4friendshiptransitive triplets (1) New ties: Number of transitive triplets transTrip1 creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1121
friendship.obj.eval.5friendshiptransitive triplets (2) Number of transitive triplets transTrip2 eval FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1122
friendship.obj.endow.5friendshiptransitive triplets (2) Lost ties: Number of transitive triplets transTrip2 endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1123
friendship.obj.creation.5friendshiptransitive triplets (2) New ties: Number of transitive triplets transTrip2 creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1124
friendship.obj.eval.6friendshiptransitive mediated triplets Number of transitive triplets transMedTrip eval FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1125
friendship.obj.endow.6friendshiptransitive mediated triplets Lost ties: Number of transitive triplets transMedTrip endow FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1126
friendship.obj.creation.6friendshiptransitive mediated triplets New ties: Number of transitive triplets transMedTrip creationFALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1127
friendship.obj.eval.7friendshiptransitive recipr. triplets Number of transitive recipr. triplets transRecTrip eval FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1128
friendship.obj.endow.7friendshiptransitive recipr. triplets Lost ties: Number of transitive recipr. tripletstransRecTrip endow FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1129
friendship.obj.creation.7friendshiptransitive recipr. triplets New ties: Number of transitive recipr. triplets transRecTrip creationFALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1130
friendship.obj.eval.170friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11491
friendship.obj.endow.157friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11492
friendship.obj.creation.157friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11493
friendship.obj.eval.171friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11494
friendship.obj.endow.158friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11495
friendship.obj.creation.158friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11496
friendship.obj.eval.172friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11497
friendship.obj.endow.159friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11498
friendship.obj.creation.159friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11499
friendship.obj.eval.173friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11500
friendship.obj.endow.160friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11501
friendship.obj.creation.160friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11502
friendship.obj.eval.174friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11503
friendship.obj.endow.161friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11504
friendship.obj.creation.161friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11505
friendship.obj.eval.175friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11506
friendship.obj.endow.162friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11507
friendship.obj.creation.162friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11508
friendship.obj.eval.176friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11509
friendship.obj.endow.163friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11510
friendship.obj.creation.163friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11511
friendship.obj.eval.177friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11512
friendship.obj.endow.164friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11513
friendship.obj.creation.164friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11514
friendship.obj.eval.178friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11515
friendship.obj.endow.165friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11516
friendship.obj.creation.165friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11517
friendship.obj.eval.179friendshipfrom friendship agr. weighted by friendship indm.tr. XWW, W = friendship, weigth ind. friendship from.w.indfriendshipfriendshipeval FALSEFALSEFALSE0dyadicFALSENULLNULLoneModeGroup11518
friendship.obj.endow.166friendshipfrom friendship agr. weighted by friendship indLost ties: m.tr. XWW, W = friendship, weigth ind. friendshipfrom.w.indfriendshipfriendshipendow FALSEFALSEFALSE0dyadicFALSENULLNULLoneModeGroup11519
friendship.obj.creation.166friendshipfrom friendship agr. weighted by friendship indNew ties: m.tr. XWW, W = friendship, weigth ind. friendship from.w.indfriendshipfriendshipcreationFALSEFALSEFALSE0dyadicFALSENULLNULLoneModeGroup11520
# Create object with algorithm settings
# Accept defaults but specify name for output file
# (which you may replace by any name you prefer)
#?sienaAlgorithmCreate
myalgorithm <- sienaAlgorithmCreate( projname = './data/s50_RSiena_output' )
If you use this algorithm object, siena07 will create/use an output file ./data/s50_RSiena_output.txt .
# Estimate parameters
#?siena07
ans <- siena07( myalgorithm, data = mydata, effects = myeff)
ans
Estimates, standard errors and convergence t-ratios

                                   Estimate   Standard   Convergence 
                                                Error      t-ratio   

Rate parameters: 
  0.1      Rate parameter period 1  6.6429  ( 1.1563   )             
  0.2      Rate parameter period 2  5.2683  ( 0.9107   )             

Other parameters: 
  1.  eval outdegree (density)     -2.7298  ( 0.1221   )   -0.0502   
  2.  eval reciprocity              2.4405  ( 0.2122   )   -0.0438   
  3.  eval transitive triplets      0.6551  ( 0.1532   )   -0.1090   
  4.  eval 3-cycles                -0.0810  ( 0.3050   )   -0.0999   
  5.  eval smoke1 similarity        0.2000  ( 0.1993   )   -0.0658   
  6.  eval alcohol alter           -0.0139  ( 0.0704   )   -0.0336   
  7.  eval alcohol ego              0.0578  ( 0.0748   )   -0.0026   
  8.  eval alcohol similarity       0.7253  ( 0.3003   )   -0.0420   

Overall maximum convergence ratio:    0.1750 


Total of 2078 iteration steps.
# This gives results from a random starting point.
# To use a fixed starting point, use the "seed" parameter:
# myalgorithm <- sienaAlgorithmCreate( projname = 's50', seed=435123 )

# For checking convergence, look at the
# 'Overall maximum convergence ratio' mentioned under the parameter estimates.
# It can also be shown by requesting
ans$tconv.max
# If this is less than 0.25, convergence is good.
# If convergence is inadequate, estimate once more,
A matrix: 1 × 1 of type dbl
0.1749599
# using the result obtained as the "previous answer"
# from which estimation continues:

ans <- siena07( myalgorithm, data = mydata, effects = myeff, prevAns=ans)
ans
Estimates, standard errors and convergence t-ratios

                                   Estimate   Standard   Convergence 
                                                Error      t-ratio   

Rate parameters: 
  0.1      Rate parameter period 1  6.5987  ( 1.1420   )             
  0.2      Rate parameter period 2  5.2479  ( 0.9013   )             

Other parameters: 
  1.  eval outdegree (density)     -2.7497  ( 0.1274   )   -0.0337   
  2.  eval reciprocity              2.4843  ( 0.2264   )   -0.0296   
  3.  eval transitive triplets      0.7102  ( 0.1343   )   -0.0524   
  4.  eval 3-cycles                -0.1962  ( 0.2711   )   -0.0873   
  5.  eval smoke1 similarity        0.1962  ( 0.2054   )    0.0154   
  6.  eval alcohol alter           -0.0139  ( 0.0735   )   -0.0647   
  7.  eval alcohol ego              0.0486  ( 0.0769   )   -0.0492   
  8.  eval alcohol similarity       0.7276  ( 0.3153   )   -0.0681   

Overall maximum convergence ratio:    0.3318 


Total of 2507 iteration steps.
# If convergence is good, you can look at the estimates.
# More extensive results
summary(ans)
Estimates, standard errors and convergence t-ratios

                                   Estimate   Standard   Convergence 
                                                Error      t-ratio   

Rate parameters: 
  0.1      Rate parameter period 1  6.5987  ( 1.1420   )             
  0.2      Rate parameter period 2  5.2479  ( 0.9013   )             

Other parameters: 
  1.  eval outdegree (density)     -2.7497  ( 0.1274   )   -0.0337   
  2.  eval reciprocity              2.4843  ( 0.2264   )   -0.0296   
  3.  eval transitive triplets      0.7102  ( 0.1343   )   -0.0524   
  4.  eval 3-cycles                -0.1962  ( 0.2711   )   -0.0873   
  5.  eval smoke1 similarity        0.1962  ( 0.2054   )    0.0154   
  6.  eval alcohol alter           -0.0139  ( 0.0735   )   -0.0647   
  7.  eval alcohol ego              0.0486  ( 0.0769   )   -0.0492   
  8.  eval alcohol similarity       0.7276  ( 0.3153   )   -0.0681   

Overall maximum convergence ratio:    0.3318 


Total of 2507 iteration steps.

Covariance matrix of estimates (correlations below diagonal)

       0.016       -0.019       -0.008        0.009       -0.004        0.000        0.000       -0.007
      -0.659        0.051        0.012       -0.031        0.002        0.000        0.000        0.000
      -0.471        0.391        0.018       -0.030        0.000        0.000       -0.001        0.002
       0.261       -0.502       -0.824        0.073       -0.001        0.000        0.000       -0.002
      -0.153        0.052        0.006       -0.026        0.042        0.004        0.004       -0.013
       0.030       -0.020       -0.010       -0.025        0.280        0.005       -0.002       -0.001
      -0.029        0.021       -0.081        0.016        0.227       -0.360        0.006       -0.001
      -0.179        0.002        0.044       -0.027       -0.195       -0.028       -0.041        0.099

Derivative matrix of expected statistics X by parameters:

     307.725      245.155      526.623      164.347       31.609       23.598       33.775       24.704
     138.365      147.579      264.155       88.164       12.847       16.351       14.557       11.462
     350.325      315.808     1159.165      365.130       34.010       69.683       79.320       25.192
     169.536      165.882      550.416      184.755       16.710       33.153       33.168       12.358
      32.124       25.976       56.832       17.727       38.240      -44.446      -40.842        6.332
      14.856       21.264       80.128       28.661      -43.852      311.565      197.524        0.786
      31.378       29.850      143.206       45.094      -38.377      212.422      303.070        2.957
      27.112       22.951       44.680       13.811        6.144        2.123        2.991       13.610

Covariance matrix of X (correlations below diagonal):

     480.139      419.154     1152.795      367.347       51.644       68.977       71.176       40.934
       0.931      422.413     1121.278      364.679       46.312       72.085       65.059       37.305
       0.798        0.828     4341.699     1395.871      133.177      250.193      265.263       90.505
       0.785        0.831        0.992      455.923       42.436       82.880       83.736       28.358
       0.350        0.335        0.300        0.295       45.281      -53.506      -51.800        7.965
       0.155        0.173        0.187        0.191       -0.391      413.110      333.103        8.260
       0.160        0.156        0.198        0.193       -0.379        0.807      412.416        8.513
       0.467        0.454        0.343        0.332        0.296        0.102        0.105       16.002
# Still more extensive results are given in the output file
# s50.txt in the current directory.

# Note that by putting an R command between parentheses (....),
# the result will also be printed to the screen.
# Next add the transitive reciprocated triplets effect,
# an interaction between transitive triplets and reciprocity,

(myeff <- includeEffects( myeff, transRecTrip))
(ans1 <- siena07( myalgorithm, data = mydata, effects = myeff, prevAns=ans))
# If necessary, repeat the estimation with the new result:
(ans1 <- siena07( myalgorithm, data = mydata, effects = myeff, prevAns=ans1))
  effectName                  include fix   test  initialValue parm
1 transitive recipr. triplets TRUE    FALSE FALSE          0   0   
A sienaEffects: 520 × 31
nameeffectNamefunctionNameshortNameinteraction1interaction2typebasicRateincluderandomEffectseffect3interactionTypelocalsettingeffectFnstatisticFnnetTypegroupNamegroupeffectNumber
<chr><chr><chr><chr><chr><chr><chr><lgl><lgl><lgl><int><chr><lgl><chr><list><list><chr><chr><dbl><int>
friendship.rate.1friendshipconstant friendship rate (period 1) Amount of network change in period 1 Rate rate TRUE TRUEFALSE0 TRUENULLNULLoneModeGroup11 1
friendship.rate.2friendshipconstant friendship rate (period 2) Amount of network change in period 2 Rate rate TRUE TRUEFALSE0 TRUENULLNULLoneModeGroup11 2
friendship.rate.3friendshipoutdegree effect on rate friendship Amount of change x outdegrees outRate rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 3
friendship.rate.4friendshipindegree effect on rate friendship Amount of change x indegrees inRate rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 4
friendship.rate.5friendshipreciprocity effect on rate friendship Amount of change x reciprocity recipRate rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 5
friendship.rate.6friendshipeffect 1/outdegree on rate friendship Amount of change x (1/outdegrees) outRateInv rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 6
friendship.rate.7friendshipeffect ln(outdegree+1) on rate friendshipAmount of change x ln(outdegrees+1) outRateLog rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 7
friendship.rate.8friendshipeffect smoke1 on rate Amount of change x smoke1 RateX smoke1 rate FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11 8
friendship.rate.9friendshipeffect alcohol on rate Amount of change x alcohol RateX alcoholrate FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11 9
friendship.obj.eval.1friendshipoutdegree (density) Number of ties density eval FALSE TRUE TRUE0dyadic TRUENULLNULLoneModeGroup1110
friendship.obj.endow.1friendshipoutdegree (density) Lost ties: Number of ties density endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1111
friendship.obj.creation.1friendshipoutdegree (density) New ties: Number of ties density creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1112
friendship.obj.eval.2friendshipreciprocity Number of reciprocated ties recip eval FALSE TRUEFALSE0dyadic TRUENULLNULLoneModeGroup1113
friendship.obj.endow.2friendshipreciprocity Lost ties: Number of reciprocated ties recip endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1114
friendship.obj.creation.2friendshipreciprocity New ties: Number of reciprocated ties recip creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1115
friendship.obj.eval.3friendshiptransitive triplets Number of transitive triplets transTrip eval FALSE TRUEFALSE0 TRUENULLNULLoneModeGroup1116
friendship.obj.endow.3friendshiptransitive triplets Lost ties: Number of transitive triplets transTrip endow FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1117
friendship.obj.creation.3friendshiptransitive triplets New ties: Number of transitive triplets transTrip creationFALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1118
friendship.obj.eval.4friendshiptransitive triplets (1) Number of transitive triplets transTrip1 eval FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1119
friendship.obj.endow.4friendshiptransitive triplets (1) Lost ties: Number of transitive triplets transTrip1 endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1120
friendship.obj.creation.4friendshiptransitive triplets (1) New ties: Number of transitive triplets transTrip1 creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1121
friendship.obj.eval.5friendshiptransitive triplets (2) Number of transitive triplets transTrip2 eval FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1122
friendship.obj.endow.5friendshiptransitive triplets (2) Lost ties: Number of transitive triplets transTrip2 endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1123
friendship.obj.creation.5friendshiptransitive triplets (2) New ties: Number of transitive triplets transTrip2 creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1124
friendship.obj.eval.6friendshiptransitive mediated triplets Number of transitive triplets transMedTrip eval FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1125
friendship.obj.endow.6friendshiptransitive mediated triplets Lost ties: Number of transitive triplets transMedTrip endow FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1126
friendship.obj.creation.6friendshiptransitive mediated triplets New ties: Number of transitive triplets transMedTrip creationFALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1127
friendship.obj.eval.7friendshiptransitive recipr. triplets Number of transitive recipr. triplets transRecTrip eval FALSE TRUEFALSE0 TRUENULLNULLoneModeGroup1128
friendship.obj.endow.7friendshiptransitive recipr. triplets Lost ties: Number of transitive recipr. tripletstransRecTrip endow FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1129
friendship.obj.creation.7friendshiptransitive recipr. triplets New ties: Number of transitive recipr. triplets transRecTrip creationFALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1130
friendship.obj.eval.170friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11491
friendship.obj.endow.157friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11492
friendship.obj.creation.157friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11493
friendship.obj.eval.171friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11494
friendship.obj.endow.158friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11495
friendship.obj.creation.158friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11496
friendship.obj.eval.172friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11497
friendship.obj.endow.159friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11498
friendship.obj.creation.159friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11499
friendship.obj.eval.173friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11500
friendship.obj.endow.160friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11501
friendship.obj.creation.160friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11502
friendship.obj.eval.174friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11503
friendship.obj.endow.161friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11504
friendship.obj.creation.161friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11505
friendship.obj.eval.175friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11506
friendship.obj.endow.162friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11507
friendship.obj.creation.162friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11508
friendship.obj.eval.176friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11509
friendship.obj.endow.163friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11510
friendship.obj.creation.163friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11511
friendship.obj.eval.177friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11512
friendship.obj.endow.164friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11513
friendship.obj.creation.164friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11514
friendship.obj.eval.178friendshipunspecified interaction effect unspecified interaction statistic unspInt eval FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11515
friendship.obj.endow.165friendshipunspecified interaction effect Lost ties: unspecified interaction statistic unspInt endow FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11516
friendship.obj.creation.165friendshipunspecified interaction effect New ties: unspecified interaction statistic unspInt creationFALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11517
friendship.obj.eval.179friendshipfrom friendship agr. weighted by friendship indm.tr. XWW, W = friendship, weigth ind. friendship from.w.indfriendshipfriendshipeval FALSEFALSEFALSE0dyadicFALSENULLNULLoneModeGroup11518
friendship.obj.endow.166friendshipfrom friendship agr. weighted by friendship indLost ties: m.tr. XWW, W = friendship, weigth ind. friendshipfrom.w.indfriendshipfriendshipendow FALSEFALSEFALSE0dyadicFALSENULLNULLoneModeGroup11519
friendship.obj.creation.166friendshipfrom friendship agr. weighted by friendship indNew ties: m.tr. XWW, W = friendship, weigth ind. friendship from.w.indfriendshipfriendshipcreationFALSEFALSEFALSE0dyadicFALSENULLNULLoneModeGroup11520
Estimates, standard errors and convergence t-ratios

                                       Estimate   Standard   Convergence 
                                                    Error      t-ratio   

Rate parameters: 
  0.1      Rate parameter period 1      6.2152  ( 1.0314   )             
  0.2      Rate parameter period 2      5.1112  ( 0.8516   )             

Other parameters: 
  1.  eval outdegree (density)         -2.9470  ( 0.1678   )   -0.0379   
  2.  eval reciprocity                  2.9023  ( 0.2929   )    0.0076   
  3.  eval transitive triplets          0.9058  ( 0.1609   )   -0.0042   
  4.  eval transitive recipr. triplets -0.9005  ( 0.2770   )   -0.0033   
  5.  eval 3-cycles                     0.5051  ( 0.2724   )   -0.0135   
  6.  eval smoke1 similarity            0.1636  ( 0.2034   )    0.0113   
  7.  eval alcohol alter               -0.0241  ( 0.0709   )    0.0079   
  8.  eval alcohol ego                  0.0459  ( 0.0769   )    0.0107   
  9.  eval alcohol similarity           0.7283  ( 0.2996   )    0.0214   

Overall maximum convergence ratio:    0.1767 


Total of 2495 iteration steps.
Estimates, standard errors and convergence t-ratios

                                       Estimate   Standard   Convergence 
                                                    Error      t-ratio   

Rate parameters: 
  0.1      Rate parameter period 1      6.2214  ( 1.0105   )             
  0.2      Rate parameter period 2      5.0716  ( 0.8385   )             

Other parameters: 
  1.  eval outdegree (density)         -2.9360  ( 0.1534   )    0.0005   
  2.  eval reciprocity                  2.8922  ( 0.2597   )    0.0084   
  3.  eval transitive triplets          0.8966  ( 0.1535   )   -0.0090   
  4.  eval transitive recipr. triplets -0.9056  ( 0.2583   )   -0.0030   
  5.  eval 3-cycles                     0.5302  ( 0.2677   )   -0.0084   
  6.  eval smoke1 similarity            0.1527  ( 0.2145   )   -0.0425   
  7.  eval alcohol alter               -0.0230  ( 0.0728   )    0.0266   
  8.  eval alcohol ego                  0.0420  ( 0.0777   )    0.0151   
  9.  eval alcohol similarity           0.7251  ( 0.3062   )   -0.0400   

Overall maximum convergence ratio:    0.0804 


Total of 2615 iteration steps.
# This might still not have an overall maximum convergence ratio
# less than 0.25. If not, you could go on once more.
#
# Inspect the file s50.txt in your working directory
# and understand the meaning of its contents.
# To have a joint test of the three effects of alcohol:
# ?Multipar.RSiena
Multipar.RSiena(ans1, 7:9)
# Focusing on alcohol similarity, the effect is significant;
# diluting the effects of alcohol by also considering ego and alter,
# the three effects simultaneously are not significant.
Tested effects:
 friendship: alcohol alter 
 friendship: alcohol ego 
 friendship: alcohol similarity 
chi-squared = 5.98, d.f. = 3;  p = 0.113. 
###                Assignment 1                                              
# 1a.
# Drop the effect of smoke1 similarity and estimate the model again.
# Do this by the function setEffects() using the <<include>> parameter.
# Give the changed effects object and the new answer object new names,
# such as effects1 and ans1, to distinguish them.
# 1b.
# Change the three effects of alcohol to the single effect
# of alcohol similarity, and estimate again.
###                Networks and behavior study                               
# Now we redefine the role of alcohol drinking
# as a dependent behaviour variable.
# Once again, look at the help file
# ?sienaDependent
# now paying special attention to the <<type>> parameter.
drinking <- sienaDependent( drink, type = "behavior" )
# Put the variables together in the data set for analysis
NBdata <- sienaDataCreate( friendship, smoke1, drinking )
NBdata
Dependent variables:  friendship, drinking 
Number of observations: 3 

Nodeset                  Actors 
Number of nodes              50 

Dependent variable friendship      
Type               oneMode         
Observations       3               
Nodeset            Actors          
Densities          0.046 0.047 0.05

Dependent variable drinking
Type               behavior
Observations       3       
Nodeset            Actors  
Range              1 - 5   

Constant covariates:  smoke1 
NBeff <- getEffects( NBdata )
effectsDocumentation(NBeff)
NBeff <- includeEffects( NBeff, transTrip, transRecTrip )
NBeff <- includeEffects( NBeff, egoX, egoSqX, altX, altSqX, diffSqX,
                         interaction1 = "drinking" )
NBeff <- includeEffects( NBeff, egoX, altX, simX, interaction1 = "smoke1" )
NBeff
  effectName                  include fix   test  initialValue parm
1 transitive triplets         TRUE    FALSE FALSE          0   0   
2 transitive recipr. triplets TRUE    FALSE FALSE          0   0   
  effectName             include fix   test  initialValue parm
1 drinking alter         TRUE    FALSE FALSE          0   0   
2 drinking squared alter TRUE    FALSE FALSE          0   0   
3 drinking ego           TRUE    FALSE FALSE          0   0   
4 drinking squared ego   TRUE    FALSE FALSE          0   0   
5 drinking diff. squared TRUE    FALSE FALSE          0   0   
  effectName        include fix   test  initialValue parm
1 smoke1 alter      TRUE    FALSE FALSE          0   0   
2 smoke1 ego        TRUE    FALSE FALSE          0   0   
3 smoke1 similarity TRUE    FALSE FALSE          0   0   
A sienaEffects: 683 × 31
nameeffectNamefunctionNameshortNameinteraction1interaction2typebasicRateincluderandomEffectseffect3interactionTypelocalsettingeffectFnstatisticFnnetTypegroupNamegroupeffectNumber
<chr><chr><chr><chr><chr><chr><chr><lgl><lgl><lgl><int><chr><lgl><chr><list><list><chr><chr><dbl><int>
friendship.rate.1friendshipconstant friendship rate (period 1) Amount of network change in period 1 Rate rate TRUE TRUEFALSE0 TRUENULLNULLoneModeGroup11 1
friendship.rate.2friendshipconstant friendship rate (period 2) Amount of network change in period 2 Rate rate TRUE TRUEFALSE0 TRUENULLNULLoneModeGroup11 2
friendship.rate.3friendshipoutdegree effect on rate friendship Amount of change x outdegrees outRate rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 3
friendship.rate.4friendshipindegree effect on rate friendship Amount of change x indegrees inRate rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 4
friendship.rate.5friendshipreciprocity effect on rate friendship Amount of change x reciprocity recipRate rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 5
friendship.rate.6friendshipeffect 1/outdegree on rate friendship Amount of change x (1/outdegrees) outRateInv rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 6
friendship.rate.7friendshipeffect ln(outdegree+1) on rate friendshipAmount of change x ln(outdegrees+1) outRateLog rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 7
friendship.rate.8friendshipeffect smoke1 on rate Amount of change x smoke1 RateX smoke1 rate FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11 8
friendship.rate.9friendshipeffect drinking on rate Amount of change x drinking RateX drinkingrate FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11 9
friendship.obj.eval.1friendshipoutdegree (density) Number of ties density eval FALSE TRUE TRUE0dyadic TRUENULLNULLoneModeGroup1110
friendship.obj.endow.1friendshipoutdegree (density) Lost ties: Number of ties density endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1111
friendship.obj.creation.1friendshipoutdegree (density) New ties: Number of ties density creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1112
friendship.obj.eval.2friendshipreciprocity Number of reciprocated ties recip eval FALSE TRUEFALSE0dyadic TRUENULLNULLoneModeGroup1113
friendship.obj.endow.2friendshipreciprocity Lost ties: Number of reciprocated ties recip endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1114
friendship.obj.creation.2friendshipreciprocity New ties: Number of reciprocated ties recip creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1115
friendship.obj.eval.3friendshiptransitive triplets Number of transitive triplets transTrip eval FALSE TRUEFALSE0 TRUENULLNULLoneModeGroup1116
friendship.obj.endow.3friendshiptransitive triplets Lost ties: Number of transitive triplets transTrip endow FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1117
friendship.obj.creation.3friendshiptransitive triplets New ties: Number of transitive triplets transTrip creationFALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1118
friendship.obj.eval.4friendshiptransitive triplets (1) Number of transitive triplets transTrip1 eval FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1119
friendship.obj.endow.4friendshiptransitive triplets (1) Lost ties: Number of transitive triplets transTrip1 endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1120
friendship.obj.creation.4friendshiptransitive triplets (1) New ties: Number of transitive triplets transTrip1 creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1121
friendship.obj.eval.5friendshiptransitive triplets (2) Number of transitive triplets transTrip2 eval FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1122
friendship.obj.endow.5friendshiptransitive triplets (2) Lost ties: Number of transitive triplets transTrip2 endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1123
friendship.obj.creation.5friendshiptransitive triplets (2) New ties: Number of transitive triplets transTrip2 creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1124
friendship.obj.eval.6friendshiptransitive mediated triplets Number of transitive triplets transMedTrip eval FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1125
friendship.obj.endow.6friendshiptransitive mediated triplets Lost ties: Number of transitive triplets transMedTrip endow FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1126
friendship.obj.creation.6friendshiptransitive mediated triplets New ties: Number of transitive triplets transMedTrip creationFALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1127
friendship.obj.eval.7friendshiptransitive recipr. triplets Number of transitive recipr. triplets transRecTrip eval FALSE TRUEFALSE0 TRUENULLNULLoneModeGroup1128
friendship.obj.endow.7friendshiptransitive recipr. triplets Lost ties: Number of transitive recipr. tripletstransRecTrip endow FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1129
friendship.obj.creation.7friendshiptransitive recipr. triplets New ties: Number of transitive recipr. triplets transRecTrip creationFALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1130
drinking.obj.eval.62drinkingdrinking: pos. contrast outd. (friendship) - smoke1sum drinking * abs.outd. (friendship) - smoke1 degPosContrXsmoke1friendshipeval FALSEFALSEFALSE0OKFALSENULLNULLbehaviorGroup11654
drinking.obj.endow.30drinkingdrinking: pos. contrast outd. (friendship) - smoke1sum drinking * abs.outd. (friendship) - smoke1 degPosContrXsmoke1friendshipendow FALSEFALSEFALSE0OKFALSENULLNULLbehaviorGroup11655
drinking.obj.creation.30drinkingdrinking: pos. contrast outd. (friendship) - smoke1sum drinking * abs.outd. (friendship) - smoke1 degPosContrXsmoke1friendshipcreationFALSEFALSEFALSE0OKFALSENULLNULLbehaviorGroup11656
drinking.obj.eval.63drinkingdrinking: neg. contrast outd. (friendship) - smoke1sum drinking * abs.outd. (friendship) - smoke1 degNegContrXsmoke1friendshipeval FALSEFALSEFALSE0OKFALSENULLNULLbehaviorGroup11657
drinking.obj.endow.31drinkingdrinking: neg. contrast outd. (friendship) - smoke1sum drinking * abs.outd. (friendship) - smoke1 degNegContrXsmoke1friendshipendow FALSEFALSEFALSE0OKFALSENULLNULLbehaviorGroup11658
drinking.obj.creation.31drinkingdrinking: neg. contrast outd. (friendship) - smoke1sum drinking * abs.outd. (friendship) - smoke1 degNegContrXsmoke1friendshipcreationFALSEFALSEFALSE0OKFALSENULLNULLbehaviorGroup11659
drinking.obj.eval.64drinkingdrinking: av. sim. (friendship) x ego's smoke1 drinking av. sim. (friendship) x ego's smoke1 avSimEgoX smoke1friendshipeval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11660
drinking.obj.endow.32drinkingdrinking: av. sim. (friendship) x ego's smoke1 drinking av. sim. (friendship) x ego's smoke1 avSimEgoX smoke1friendshipendow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11661
drinking.obj.creation.32drinkingdrinking: av. sim. (friendship) x ego's smoke1 drinking av. sim. (friendship) x ego's smoke1 avSimEgoX smoke1friendshipcreationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11662
drinking.obj.eval.65drinkingdrinking: tot. sim. (friendship) x ego's smoke1 drinking tot. sim. (friendship) x ego's smoke1 totSimEgoX smoke1friendshipeval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11663
drinking.obj.endow.33drinkingdrinking: tot. sim. (friendship) x ego's smoke1 drinking tot. sim. (friendship) x ego's smoke1 totSimEgoX smoke1friendshipendow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11664
drinking.obj.creation.33drinkingdrinking: tot. sim. (friendship) x ego's smoke1 drinking tot. sim. (friendship) x ego's smoke1 totSimEgoX smoke1friendshipcreationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11665
drinking.obj.eval.66drinkingdrinking: av. alters (friendship) x ego's smoke1 drinking av. alters (friendship) x ego's smoke1 avAltEgoX smoke1friendshipeval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11666
drinking.obj.endow.34drinkingdrinking: av. alters (friendship) x ego's smoke1 drinking av. alters (friendship) x ego's smoke1 avAltEgoX smoke1friendshipendow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11667
drinking.obj.creation.34drinkingdrinking: av. alters (friendship) x ego's smoke1 drinking av. alters (friendship) x ego's smoke1 avAltEgoX smoke1friendshipcreationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11668
drinking.obj.eval.67drinkingdrinking: tot. alt's (friendship) x ego's smoke1 drinking tot. alt's (friendship) x ego's smoke1 totAltEgoX smoke1friendshipeval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11669
drinking.obj.endow.35drinkingdrinking: tot. alt's (friendship) x ego's smoke1 drinking tot. alt's (friendship) x ego's smoke1 totAltEgoX smoke1friendshipendow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11670
drinking.obj.creation.35drinkingdrinking: tot. alt's (friendship) x ego's smoke1 drinking tot. alt's (friendship) x ego's smoke1 totAltEgoX smoke1friendshipcreationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11671
drinking.obj.eval.68drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt eval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11672
drinking.obj.endow.36drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt endow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11673
drinking.obj.creation.36drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt creationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11674
drinking.obj.eval.69drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt eval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11675
drinking.obj.endow.37drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt endow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11676
drinking.obj.creation.37drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt creationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11677
drinking.obj.eval.70drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt eval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11678
drinking.obj.endow.38drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt endow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11679
drinking.obj.creation.38drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt creationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11680
drinking.obj.eval.71drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt eval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11681
drinking.obj.endow.39drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt endow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11682
drinking.obj.creation.39drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt creationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11683
# For including effects also for the dependent behaviour variable, see
# ?includeEffects
NBeff <- includeEffects( NBeff, avAlt, name="drinking",
                         interaction1 = "friendship" )
NBeff
  effectName             include fix   test  initialValue parm
1 drinking average alter TRUE    FALSE FALSE          0   0   
A sienaEffects: 683 × 31
nameeffectNamefunctionNameshortNameinteraction1interaction2typebasicRateincluderandomEffectseffect3interactionTypelocalsettingeffectFnstatisticFnnetTypegroupNamegroupeffectNumber
<chr><chr><chr><chr><chr><chr><chr><lgl><lgl><lgl><int><chr><lgl><chr><list><list><chr><chr><dbl><int>
friendship.rate.1friendshipconstant friendship rate (period 1) Amount of network change in period 1 Rate rate TRUE TRUEFALSE0 TRUENULLNULLoneModeGroup11 1
friendship.rate.2friendshipconstant friendship rate (period 2) Amount of network change in period 2 Rate rate TRUE TRUEFALSE0 TRUENULLNULLoneModeGroup11 2
friendship.rate.3friendshipoutdegree effect on rate friendship Amount of change x outdegrees outRate rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 3
friendship.rate.4friendshipindegree effect on rate friendship Amount of change x indegrees inRate rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 4
friendship.rate.5friendshipreciprocity effect on rate friendship Amount of change x reciprocity recipRate rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 5
friendship.rate.6friendshipeffect 1/outdegree on rate friendship Amount of change x (1/outdegrees) outRateInv rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 6
friendship.rate.7friendshipeffect ln(outdegree+1) on rate friendshipAmount of change x ln(outdegrees+1) outRateLog rate FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup11 7
friendship.rate.8friendshipeffect smoke1 on rate Amount of change x smoke1 RateX smoke1 rate FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11 8
friendship.rate.9friendshipeffect drinking on rate Amount of change x drinking RateX drinkingrate FALSEFALSEFALSE0 FALSENULLNULLoneModeGroup11 9
friendship.obj.eval.1friendshipoutdegree (density) Number of ties density eval FALSE TRUE TRUE0dyadic TRUENULLNULLoneModeGroup1110
friendship.obj.endow.1friendshipoutdegree (density) Lost ties: Number of ties density endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1111
friendship.obj.creation.1friendshipoutdegree (density) New ties: Number of ties density creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1112
friendship.obj.eval.2friendshipreciprocity Number of reciprocated ties recip eval FALSE TRUEFALSE0dyadic TRUENULLNULLoneModeGroup1113
friendship.obj.endow.2friendshipreciprocity Lost ties: Number of reciprocated ties recip endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1114
friendship.obj.creation.2friendshipreciprocity New ties: Number of reciprocated ties recip creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1115
friendship.obj.eval.3friendshiptransitive triplets Number of transitive triplets transTrip eval FALSE TRUEFALSE0 TRUENULLNULLoneModeGroup1116
friendship.obj.endow.3friendshiptransitive triplets Lost ties: Number of transitive triplets transTrip endow FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1117
friendship.obj.creation.3friendshiptransitive triplets New ties: Number of transitive triplets transTrip creationFALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1118
friendship.obj.eval.4friendshiptransitive triplets (1) Number of transitive triplets transTrip1 eval FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1119
friendship.obj.endow.4friendshiptransitive triplets (1) Lost ties: Number of transitive triplets transTrip1 endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1120
friendship.obj.creation.4friendshiptransitive triplets (1) New ties: Number of transitive triplets transTrip1 creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1121
friendship.obj.eval.5friendshiptransitive triplets (2) Number of transitive triplets transTrip2 eval FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1122
friendship.obj.endow.5friendshiptransitive triplets (2) Lost ties: Number of transitive triplets transTrip2 endow FALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1123
friendship.obj.creation.5friendshiptransitive triplets (2) New ties: Number of transitive triplets transTrip2 creationFALSEFALSEFALSE0dyadic TRUENULLNULLoneModeGroup1124
friendship.obj.eval.6friendshiptransitive mediated triplets Number of transitive triplets transMedTrip eval FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1125
friendship.obj.endow.6friendshiptransitive mediated triplets Lost ties: Number of transitive triplets transMedTrip endow FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1126
friendship.obj.creation.6friendshiptransitive mediated triplets New ties: Number of transitive triplets transMedTrip creationFALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1127
friendship.obj.eval.7friendshiptransitive recipr. triplets Number of transitive recipr. triplets transRecTrip eval FALSE TRUEFALSE0 TRUENULLNULLoneModeGroup1128
friendship.obj.endow.7friendshiptransitive recipr. triplets Lost ties: Number of transitive recipr. tripletstransRecTrip endow FALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1129
friendship.obj.creation.7friendshiptransitive recipr. triplets New ties: Number of transitive recipr. triplets transRecTrip creationFALSEFALSEFALSE0 TRUENULLNULLoneModeGroup1130
drinking.obj.eval.62drinkingdrinking: pos. contrast outd. (friendship) - smoke1sum drinking * abs.outd. (friendship) - smoke1 degPosContrXsmoke1friendshipeval FALSEFALSEFALSE0OKFALSENULLNULLbehaviorGroup11654
drinking.obj.endow.30drinkingdrinking: pos. contrast outd. (friendship) - smoke1sum drinking * abs.outd. (friendship) - smoke1 degPosContrXsmoke1friendshipendow FALSEFALSEFALSE0OKFALSENULLNULLbehaviorGroup11655
drinking.obj.creation.30drinkingdrinking: pos. contrast outd. (friendship) - smoke1sum drinking * abs.outd. (friendship) - smoke1 degPosContrXsmoke1friendshipcreationFALSEFALSEFALSE0OKFALSENULLNULLbehaviorGroup11656
drinking.obj.eval.63drinkingdrinking: neg. contrast outd. (friendship) - smoke1sum drinking * abs.outd. (friendship) - smoke1 degNegContrXsmoke1friendshipeval FALSEFALSEFALSE0OKFALSENULLNULLbehaviorGroup11657
drinking.obj.endow.31drinkingdrinking: neg. contrast outd. (friendship) - smoke1sum drinking * abs.outd. (friendship) - smoke1 degNegContrXsmoke1friendshipendow FALSEFALSEFALSE0OKFALSENULLNULLbehaviorGroup11658
drinking.obj.creation.31drinkingdrinking: neg. contrast outd. (friendship) - smoke1sum drinking * abs.outd. (friendship) - smoke1 degNegContrXsmoke1friendshipcreationFALSEFALSEFALSE0OKFALSENULLNULLbehaviorGroup11659
drinking.obj.eval.64drinkingdrinking: av. sim. (friendship) x ego's smoke1 drinking av. sim. (friendship) x ego's smoke1 avSimEgoX smoke1friendshipeval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11660
drinking.obj.endow.32drinkingdrinking: av. sim. (friendship) x ego's smoke1 drinking av. sim. (friendship) x ego's smoke1 avSimEgoX smoke1friendshipendow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11661
drinking.obj.creation.32drinkingdrinking: av. sim. (friendship) x ego's smoke1 drinking av. sim. (friendship) x ego's smoke1 avSimEgoX smoke1friendshipcreationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11662
drinking.obj.eval.65drinkingdrinking: tot. sim. (friendship) x ego's smoke1 drinking tot. sim. (friendship) x ego's smoke1 totSimEgoX smoke1friendshipeval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11663
drinking.obj.endow.33drinkingdrinking: tot. sim. (friendship) x ego's smoke1 drinking tot. sim. (friendship) x ego's smoke1 totSimEgoX smoke1friendshipendow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11664
drinking.obj.creation.33drinkingdrinking: tot. sim. (friendship) x ego's smoke1 drinking tot. sim. (friendship) x ego's smoke1 totSimEgoX smoke1friendshipcreationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11665
drinking.obj.eval.66drinkingdrinking: av. alters (friendship) x ego's smoke1 drinking av. alters (friendship) x ego's smoke1 avAltEgoX smoke1friendshipeval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11666
drinking.obj.endow.34drinkingdrinking: av. alters (friendship) x ego's smoke1 drinking av. alters (friendship) x ego's smoke1 avAltEgoX smoke1friendshipendow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11667
drinking.obj.creation.34drinkingdrinking: av. alters (friendship) x ego's smoke1 drinking av. alters (friendship) x ego's smoke1 avAltEgoX smoke1friendshipcreationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11668
drinking.obj.eval.67drinkingdrinking: tot. alt's (friendship) x ego's smoke1 drinking tot. alt's (friendship) x ego's smoke1 totAltEgoX smoke1friendshipeval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11669
drinking.obj.endow.35drinkingdrinking: tot. alt's (friendship) x ego's smoke1 drinking tot. alt's (friendship) x ego's smoke1 totAltEgoX smoke1friendshipendow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11670
drinking.obj.creation.35drinkingdrinking: tot. alt's (friendship) x ego's smoke1 drinking tot. alt's (friendship) x ego's smoke1 totAltEgoX smoke1friendshipcreationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11671
drinking.obj.eval.68drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt eval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11672
drinking.obj.endow.36drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt endow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11673
drinking.obj.creation.36drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt creationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11674
drinking.obj.eval.69drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt eval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11675
drinking.obj.endow.37drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt endow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11676
drinking.obj.creation.37drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt creationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11677
drinking.obj.eval.70drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt eval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11678
drinking.obj.endow.38drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt endow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11679
drinking.obj.creation.38drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt creationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11680
drinking.obj.eval.71drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt eval FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11681
drinking.obj.endow.39drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt endow FALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11682
drinking.obj.creation.39drinkingdrinking: unspecified interaction drinking: unspecified interaction behUnspInt creationFALSEFALSEFALSE0 FALSENULLNULLbehaviorGroup11683
# Define an algorithm with a new project name
myalgorithm1 <- sienaAlgorithmCreate( projname = './data/s50NB_RSiena_output' )

# Estimate again, using the second algorithm right from the start.
NBans <- siena07( myalgorithm1, data = NBdata, effects = NBeff)
# You may improve convergence (considering the overall maximum
# convergence ratio) by repeated estimation in the same way as above.

# Look at results
NBans
If you use this algorithm object, siena07 will create/use an output file ./data/s50NB_RSiena_output.txt .
Estimates, standard errors and convergence t-ratios

                                               Estimate   Standard   Convergence 
                                                            Error      t-ratio   
Network Dynamics 
   1. rate constant friendship rate (period 1)  6.3175  ( 1.0385   )    0.0803   
   2. rate constant friendship rate (period 2)  5.0232  ( 0.7736   )    0.0334   
   3. eval outdegree (density)                 -2.8288  ( 0.2283   )   -0.0071   
   4. eval reciprocity                          2.8284  ( 0.2936   )   -0.0166   
   5. eval transitive triplets                  0.8919  ( 0.1480   )    0.0149   
   6. eval transitive recipr. triplets         -0.5107  ( 0.2409   )    0.0136   
   7. eval smoke1 alter                         0.0721  ( 0.1485   )    0.0377   
   8. eval smoke1 ego                          -0.0101  ( 0.1658   )    0.0234   
   9. eval smoke1 similarity                    0.2570  ( 0.2505   )   -0.0036   
  10. eval drinking alter                      -0.0576  ( 0.1229   )    0.0470   
  11. eval drinking squared alter              -0.1153  ( 0.1234   )   -0.0172   
  12. eval drinking ego                         0.0379  ( 0.1161   )    0.0404   
  13. eval drinking squared ego                 0.2302  ( 0.1275   )    0.0239   
  14. eval drinking diff. squared              -0.1014  ( 0.0520   )    0.0517   

Behavior Dynamics
  15. rate rate drinking (period 1)             1.3338  ( 0.3710   )    0.0627   
  16. rate rate drinking (period 2)             1.7877  ( 0.4801   )   -0.0303   
  17. eval drinking linear shape                0.4010  ( 0.1963   )    0.0123   
  18. eval drinking quadratic shape            -0.5507  ( 0.3391   )    0.0723   
  19. eval drinking average alter               1.2149  ( 0.8540   )    0.0361   

Overall maximum convergence ratio:    0.2124 


Total of 3762 iteration steps.
# Make a nicer listing of the results
siena.table(NBans, type="html", sig=TRUE)
# This produces an html file; siena.table can also produce a LaTeX file.
# But the current version (2.12) does not do this well for html.
###                Assignment 2                                              ###
################################################################################

# 2a.
# Replace the average alter effect by average similarity (avSim)
# or total similarity (totSim) and estimate the model again.
# 2b.
# Add the effect of smoking on drinking and estimate again.

################################################################################

################################################################################
###                Assignment 3                                              ###
################################################################################

# Read Sections 13.3 and 13.4 of the Siena Manual, download scripts
# SelectionTables.r and InfluenceTables.r from the Siena website,
# and make plots of the selection table and influence table for drinking.