Workshop constructing effects in RSiena


Teacher: Tom A.B. Snijders

The workshop will be online

This is a workshop for RSiena users. There are no financial costs.
The aim is that workshop participants will be able to create their own effects.
A prerequisite for the workshop is a basic knowledge of C++ programming.


How to prepare

The following are some things to prepare for the workshop.
In any case, I hope you are able to do the first two (know about inheritance and know how to install an R package from source).

  1. If you do not know about inheritance in C++, then please study this (it does not take much time).
    There is a lot of material about this on the web, e.g.:

    It will be assumed you know about inheritance and the use of virtual functions.
  2. Please prepare how to build an R package from source on your own computer. Of course, the R package will be RSiena.

    Steps:

    1. In R, make sure that you have installed the packages that are "dependencies" in RSiena:
      Matrix, lattice, parallel, MASS, methods, xtable, network, codetools.
    2. If you are using a Windows computer, install RTools from https://cran.r-project.org/bin/windows/Rtools/.
    3. Make a new directory for the workshop.
    4. Download the source code of RSiena from https://github.com/stocnet/rsiena/releases.
      Here you will find five "assets"; download one of those indicated as "source code". Unpack the file; this will give a directory which has a name such as rsiena-1.4.19, where the version number might be changed; put this as a subdirectory in the directory for the workshop you just created.
    5. If you are a Windows user, like me:
      I find it most convenient to work with three batch files.
      My R program is installed in directory "C:\ProgramFiles\R\R-4.4.1\bin\R.exe". You will have it in some other directory, and you will have to make the corresponding changes in the following batch files. My batch files are

      Download these three batch files, modify them (in a raw text editor) so that they mention the new version of RSiena and point to your own R installation; then first run buildsiena.bat and then installsiena.bat. Just for your interest, you also could run checksiena.bat.
    6. If you are a Mac or Linux/Unix user, please find your way in the "further background" below.
  3. To get a sense of some straightforward C++ classes that are used for creating effects, look at the following examples of C++ classes in RSiena.
    You can find them in https://github.com/stocnet/rsiena/tree/main/src/model/effects:

    1. AverageReciprocatedAlterEffect, which is used for the behavior effect avXAlt;
    2. IndegreePopularityEffect, which is used for the network effects inPop, inPopSqrt, and inPop.c.
    Also look at their definitions in the manual; calculating the effect statistics in these classes is done by the use of, respectively, egoStatistic and tieStatistic
  4. For further background about constructing R packages, there is a lot of material on the web. If you are on a Mac or on Linux/Unix, and you are unsure how to proceed to install a package from source, you will find help in some of the material. Examples are:



Tuesday November 5, 2024; 10.00-12.00 (time zone Amsterdam NL)

I will treat the following slide presentations :

We shall see how far I get.
In any case, we should come far enough so that you can make the assignment.

For the next meeting, there is the following assignment:



Monday November 11, 2024; 14.00-16.00 (time zone Amsterdam NL)

  • Treat the assigment
  • Question time
  • Whatever is left
  • Question time again.



Further materials

  1. Websites :

  2. Manuals :

  3. Literature :


Back to the main Siena page