Lab 4: RSiena

Exploring Habit & Friendship Formation Over Time

Yujie Guo

2017-12-01

Introduction

In this lab, you’ll be building, estimating, and interpreting actor-based longitudinal network models using RSiena.1 Tom Snijders has led the development of the Siena framework, with RSiena supplanting a specialized Windows program in 2011. You can learn more about RSiena, research using the framework, and more here. RSiena is used to model actor-based longitudinal network models in order to examine the effects of network ties over time on a certain behavior, or the effect of a certain behavior on tie formation over time. SIENA stands for Simulation Investigation for Empirical Network Analysis.

You will be using an excerpt of data from the Teenage Friends and Lifestyle Study.2 You can learn more about this data set, created by Prof. Snijders, here. The data set includes 3 network files containing friendship relationships between 50 teenage girls recorded at 3 consecutive points in time.

  1. s50-network1.dat

  2. s50-network2.dat

  3. s50-network23.dat

The data also includes information about the smoking behavior of the 50 female students (s50-smoke.dat). The smoking variable has three levels: 1 (does not smoke), 2 (smokes occasionally) and 3 (smokes regularly).

The core analysis conducted in this lab consists of taking a set of intuitive or plain language hypotheses about our data set and converting them into hypotheses in network terminology. Once we have our hypotheses, we will operationalize them into parameters in our model. Finally, we will interpret these results by testing our hypotheses.

First, we will create testable hypotheses based on intuitions about habit and friendship formation.

Hypothesis Construction (20 pts)

Analysis

Formulate hypotheses using network terminology discussed throughout the course based on the following friendship relations.3 If you get stuck, it may be helpful to look at the terms included in the model below for hints on how to translate plain-language intuitions into network terminology. The first one is done for you:

  1. Establishing and maintaining friendships takes time and resources. Students will not befriend people indiscriminately.

Hypothesis 1: Ties between students are not random.

Relational Hypotheses:

  1. If a student nominates a person as a friend, that person is also likely to consider the student a friend.

Hypothesis 2: Mutual ties tend form in network

  1. Students will be friends with the friends of their friends (if A -> B and B -> C, then A -> C).

Hypothesis 3: N.A.

  1. Leaving school to find a place where smoking is permitted takes time that could otherwise be used for socializing. Students who smoke more will have less time to establish and maintain friendships.

Hypothesis 4: Nonsmokers will have more edges thus has higher network centrality. While smokers will has less edges thus lower netwtork centrality.

  1. Smoking is increasingly frowned upon in the U.S. Students who smoke more will likely not be very popular and few people will nominate them as friends.

Hypothesis 5: N.A.

  1. People with similar smoking behavior will be more likely to become friends.

Hypothesis 6: Homophily: students with similar characteristics tend to become friends.

Smoking Behavior Hypotheses:

  1. Students will likely smoke more as they get older.

Hypothesis 7: The smoking behavior is dynamic. After time pass, non-smokers might be influenced by smokers. Light smokers might become smoker in the future.

  1. Friendship relations will make students more similar in their smoking behavior.

Hypothesis 8: Contagion theory, students tend to be influenced and have similar behaviour with his/her friends.

Loading Data & Visualizing the Friendship Network Over Time (10 pts)

To better intuitively understand our network, let’s examine three network visualizations showing the friendship network over time and the smoking behavior of the nodes.

Let’s visualize our network at the three time periods under discussion. Node size increases with smoking behavior. Green nodes represent no smoking, yellow nodes represent light smoking, and red nodes represent heavy smoking. Think about the macro-level features of each network.

Network at Time 1

Network at Time 2

Network at Time 3

Analysis

Which two nodes represent isolates in the network at all three time periods? Node 13 and Node 20

Describe the change in the network over time. Think about the formation of clusters and the incidence of smoking behavior. At first stage, there are only 7 people smoking, 5 light smoking people, there is a big component and several small components. At stage 2, more people become heavy smokers, one of whom was light smoker. Others were no smoking person and even were not friends with smkoers. Some of light smokers quit smoking.There is a gaint component in network and almost every one is in the network. At stage 3, the gaint component from stage 2 is divided into several clusters. in the clusters, it is more clear that smokers and smokers are friends, nonsmokers and nonsmokers are not friends.

Using the three visualizations, evaluate hypothesis five. N.A

Creating the SIENA Model

To build a SIENA model, we need to create dependent variables, explanatory variables, a combination of both types of variables, and our model specification.

First, we create a SIENA data object including the longitudinal friendship network and the smoking behavioral variable. The results of creating that model, smokeBehXfriendship:

## Dependent variables:  friendship, smokingbeh 
## 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 smokingbeh
## Type               behavior  
## Observations       3         
## Nodeset            Actors    
## Range              1 - 3

Using our hypotheses above, we will construct a list of parameters to test using our Siena model. A table of those parameters follows:

##    name       effectName                          include fix   test 
## 1  friendship constant friendship rate (period 1) TRUE    FALSE FALSE
## 2  friendship constant friendship rate (period 2) TRUE    FALSE FALSE
## 3  friendship outdegree (density)                 TRUE    FALSE FALSE
## 4  friendship reciprocity                         TRUE    FALSE FALSE
## 5  friendship smokingbeh alter                    TRUE    FALSE FALSE
## 6  friendship smokingbeh ego                      TRUE    FALSE FALSE
## 7  friendship same smokingbeh                     TRUE    FALSE FALSE
## 8  smokingbeh rate smokingbeh (period 1)          TRUE    FALSE FALSE
## 9  smokingbeh rate smokingbeh (period 2)          TRUE    FALSE FALSE
## 10 smokingbeh smokingbeh linear shape             TRUE    FALSE FALSE
## 11 smokingbeh smokingbeh quadratic shape          TRUE    FALSE FALSE
## 12 smokingbeh smokingbeh total similarity         TRUE    FALSE FALSE
##    initialValue parm
## 1     4.69604   0   
## 2     4.32885   0   
## 3    -1.46770   0   
## 4     0.00000   0   
## 5     0.00000   0   
## 6     0.00000   0   
## 7     0.00000   0   
## 8     0.81720   0   
## 9     0.43579   0   
## 10   -0.22314   0   
## 11    0.00000   0   
## 12    0.00000   0

Next, we will create our model. You can learn about the function that creates Siena models by typing ?sienaModelCreate into your R console.

## Estimates, standard errors and convergence t-ratios
## 
##                                                Estimate   Standard   Convergence 
##                                                             Error      t-ratio   
## Network Dynamics 
##    1. rate constant friendship rate (period 1)  5.8004  ( 1.0079   )    0.0034   
##    2. rate constant friendship rate (period 2)  4.4987  ( 0.6773   )   -0.0358   
##    3. eval outdegree (density)                 -2.7776  ( 0.2554   )    0.0045   
##    4. eval reciprocity                          2.7744  ( 0.1957   )    0.0186   
##    5. eval smokingbeh alter                     0.1042  ( 0.1592   )   -0.0831   
##    6. eval smokingbeh ego                       0.1219  ( 0.1777   )   -0.0264   
##    7. eval same smokingbeh                      0.6993  ( 0.3524   )    0.0277   
## 
## Behavior Dynamics
##    8. rate rate smokingbeh (period 1)           3.0616  ( 1.1207   )   -0.0022   
##    9. rate rate smokingbeh (period 2)           3.0556  ( 1.4214   )   -0.0427   
##   10. eval smokingbeh linear shape             -1.3596  ( 0.4231   )   -0.0738   
##   11. eval smokingbeh quadratic shape           1.9387  ( 0.3926   )   -0.0678   
##   12. eval smokingbeh total similarity          1.1299  ( 0.5980   )    0.0403   
## 
## Overall maximum convergence ratio:    0.1245 
## 
## 
## Total of 3060 iteration steps.

Checking Convergence (5 pts)

We need to check the convergence ratios in the final column to evaluate the reliability of our simulation. Individual t-ratios should be less than the absolute value of .1. The overall maximum convergence ratio should be less than .25.

Analysis

Has your model converged sufficiently? If not, note which terms have not converged, rerun your model using the previous Siena model values as your starting point, and re-evaluate. Repeat this process until the overall maximum convergence ratio and the convergence t-ratio for each term are within acceptable levels.4 If your model has not converged, uncomment prevAns = ans1 in the code block titled Model Creation and rerun that block of code and print results. This will use the previous values generated by the previous model creation as the starting point in the estimation and proceed through the model construction process again. See pp. 58—59 of the RSiena manual for more information. The model is converged sufficiently as it satisfys the requirement.

Understanding the Estimate Column

The Estimate column, also reported as the theta vector within an RSiena object’s effects vector, represents the chance of an actor forming a tie within the network based on interactions within and between networks or in relation to the presence or absence of a behavior. The Standard Error column provides information about the amount of variation among actors within the network on the given parameter.

Evaluating Significance

The following table presents the Estimate (theta) score from the preceding table, divided by Standard Error. Recall that when carrying out a t-test, a parameter is significant at the .05 level when the absolute value of the t-score is greater than 2.

sigvalues
constant friendship rate (period 1) 5.75
constant friendship rate (period 2) 6.64
outdegree (density) -10.87
reciprocity 14.18
smokingbeh alter 0.65
smokingbeh ego 0.69
same smokingbeh 1.98
rate smokingbeh (period 1) 2.73
rate smokingbeh (period 2) 2.15
smokingbeh linear shape -3.21
smokingbeh quadratic shape 4.94
smokingbeh total similarity 1.89

Reporting Your Results (65 pts)

Analysis

For each of your hypotheses, indicate which parameter operationalizes your hypothesis. Using the tables created above, evaluate that hypothesis, and report whether your results were significant.5 If you’re having difficulty matching up parameters with your hypotheses, take a look at pp. 41-49, § 6.2, in the RSiena Manual.

Hypothesis 1: The friendship rate are similar in both period 1 and 2, it’s greater than 2. Thus Ties between students are not random.

Hypothesis 2: The reciprocity is greater than 2 which indicates that mutual ties are likely to form in network.

Hypothesis 3: N.A.

Hypothesis 4: The “outdegree(density)” is -11.17, its absolute value is greater than 2 meaning the coefficient is significant. The sign is negative, thus it indicates that smokers also have time to establish and maintain friendship.

Hypothesis 5: N.A.

Hypothesis 6: The “same smokingbeh coefficient”" is greater than 2 which indicates that “homopily” valids

Hypothesis 7: The “smkingbeh with quadratic shape” is greater than 2 which indicates that students tend to smoke more when time passby.

Hypothesis 8: The “smkingbeh total similarity”" is smaller than 2 which however show that students will be less similar in smoking behaviour, i.e. nonsmokers are not tend to be influenced by smokers and start to smoke.

Submitting the Lab (5 pts)

After knitting your file to RPubs, copy the URL and paste it into the comment field of the Lab 2 Assignment on Canvas. Save this .Rmd file and submit it in the file portion of your Canvas assignment. Make sure to review your file and its formatting. Run spell check (built into RStudio) and proofread your answers before submitting. If you can’t publish to RPubs, save your HTML file as a PDF and submit that instead.6 There are many different ways to do this with different browsers. Google it.