Skip to main content

Edge based analysis with network statistics

The edge based analysis with network statistics can be conducted using the function sem.net.edge.

As an example, we analyze the the attorney cowork and advice networks. In this example, the advice network is predicted by gender and years in practice, and the cowork network is predicted by the advice network, gender, and years in practice all together. In this case, the advice network acts as a mediator, while gender and years in practice exert indirect effect onto the cowork network through the advice network in addition to having direct effects. The model specification is given below.

model <-'
  advice ~ gender + years
  cowork ~ advice + gender + years
'

To use the function sem.net.edge(), we need to specify whether the covariate values to be run with the social network edge values in SEM should be calculated as the ”difference” across two individuals or the ”average” across two individuals. Here, the argument ordered = c("cowork", "advice") is used to tell lavaan that the outcome variables cowork and advice are binary.

set.seed(100)
res <- sem.net.edge(model = model, data = data, 
                    network = network, type = "difference", ordered = c("cowork", "advice")) 

This model is again estimated in two stages. In the first stage, the non-network variables of gender and years in practice are converted to be pairwise such that years in practice for the pair of individuals $i$ and $j$ would be the difference between years in
practice for individual $i$ and for individual $j$. After obtaining the pairwise non-network statistics, these variables are compiled into the same file as the network edge variables, which are binary, and also pairwise. This data frame is then given to lavaan to be used with the SEM framework. Thus, in this model, SEM used each pair of individuals as the unit of analysis. The output can be access via summary(res$estimates, fit=TRUE) and is shown below.

lavaan 0.6.15 ended normally after 19 iterations

  Estimator                                       DWLS
  Optimization method                           NLMINB
  Number of model parameters                         7

  Number of observations                          5041

Model Test User Model:
                                              Standard      Scaled
  Test Statistic                                 0.000       0.000
  Degrees of freedom                                 0           0

Model Test Baseline Model:

  Test statistic                              1343.292    1343.292
  Degrees of freedom                                 1           1
  P-value                                        0.000       0.000
  Scaling correction factor                                  1.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    1.000       1.000
  Tucker-Lewis Index (TLI)                       1.000       1.000
                                                                  
  Robust Comparative Fit Index (CFI)                            NA
  Robust Tucker-Lewis Index (TLI)                               NA

Root Mean Square Error of Approximation:

  RMSEA                                          0.000       0.000
  90 Percent confidence interval - lower         0.000       0.000
  90 Percent confidence interval - upper         0.000       0.000
  P-value H_0: RMSEA <= 0.050                       NA          NA
  P-value H_0: RMSEA >= 0.080                       NA          NA
                                                                  
  Robust RMSEA                                                  NA
  90 Percent confidence interval - lower                        NA
  90 Percent confidence interval - upper                        NA
  P-value H_0: Robust RMSEA <= 0.050                            NA
  P-value H_0: Robust RMSEA >= 0.080                            NA

Standardized Root Mean Square Residual:

  SRMR                                           0.000       0.000

Parameter Estimates:

  Standard errors                           Robust.sem
  Information                                 Expected
  Information saturated (h1) model        Unstructured

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)
  advice ~                                            
    gender           -0.019    0.040   -0.463    0.643
    years            -0.018    0.002   -9.354    0.000
  cowork ~                                            
    advice            0.691    0.019   36.651    0.000
    gender            0.013    0.040    0.323    0.747
    years             0.013    0.002    7.248    0.000

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)
   .advice            0.000                           
   .cowork            0.000                           

Thresholds:
                   Estimate  Std.Err  z-value  P(>|z|)
    advice|t1         0.956    0.022   43.812    0.000
    cowork|t1         1.037    0.022   48.049    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .advice            1.000                           
   .cowork            0.523                           

Scales y*:
                   Estimate  Std.Err  z-value  P(>|z|)
    advice            1.000                           
    cowork            1.000