Load the library:
Set up the data:
data(lazegalaw)
Y<-lazegalaw$Y[,,2]
Xn<-lazegalaw$X[,c(2,4,5,6)]
Xd<-lazegalaw$Y[,,-2]
Xd<-array( c(Xd,outer(Xn[,4],Xn[,4],"==")),dim=dim(Xd)+c(0,0,1))
dimnames(Xd)[[3]]<-c("advice","cowork","samepractice")
dimnames(Xd)[[3]]
## [1] "advice" "cowork" "samepractice"
## [1] "female" "seniority" "age" "practice"
plot the network with “practice” denoted by plotting color:
##
## Regression coefficients:
## pmean psd z-stat p-val
## intercept -0.248 0.479 -0.518 0.605
## female.row -0.024 0.132 -0.179 0.858
## seniority.row -0.001 0.010 -0.127 0.899
## age.row -0.016 0.009 -1.898 0.058
## practice.row -0.138 0.112 -1.234 0.217
## female.col -0.057 0.121 -0.475 0.635
## seniority.col 0.017 0.009 1.895 0.058
## age.col -0.008 0.008 -0.981 0.326
## practice.col -0.200 0.103 -1.934 0.053
## advice.dyad -0.096 0.083 -1.155 0.248
## cowork.dyad 1.144 0.065 17.566 0.000
## samepractice.dyad 0.449 0.055 8.113 0.000
##
## Variance parameters:
## pmean psd
## va 0.161 0.037
## cab 0.014 0.021
## vb 0.125 0.029
## rho 0.085 0.054
## ve 1.000 0.000
##
## Regression coefficients:
## pmean psd z-stat p-val
## intercept -0.873 0.692 -1.262 0.207
## female.row -0.119 0.188 -0.634 0.526
## seniority.row -0.002 0.014 -0.135 0.893
## age.row -0.023 0.013 -1.735 0.083
## practice.row -0.069 0.166 -0.414 0.679
## female.col -0.104 0.168 -0.616 0.538
## seniority.col 0.010 0.013 0.742 0.458
## age.col -0.006 0.011 -0.507 0.612
## practice.col -0.087 0.141 -0.619 0.536
## advice.dyad -0.134 0.110 -1.212 0.226
## cowork.dyad 1.458 0.092 15.826 0.000
## samepractice.dyad 0.563 0.082 6.832 0.000
##
## Variance parameters:
## pmean psd
## va 0.298 0.077
## cab 0.026 0.042
## vb 0.176 0.052
## rho 0.149 0.091
## ve 1.000 0.000