netlm
regresses the network variable in y
on the network variables in stack x
using ordinary least squares. The resulting fits (and coefficients) are then tested against the indicated null hypothesis.
netlm(y, x, intercept=TRUE, mode="digraph", diag=FALSE, nullhyp=c("qap", "qapspp", "qapy", "qapx", "qapallx", "cugtie", "cugden", "cuguman", "classical"), test.statistic = c("t-value", "beta"), tol=1e-7, reps=1000)
"digraph"
indicates that edges should be interpreted as directed; "graph"
indicates that edges are undirected. mode
is set to "digraph"
by default. diag
is FALSE
by default. qr.solve
. reps
=1000. netlm
netlm
performs an OLS linear network regression of the graph y
on the graphs in x
. Network regression using OLS is directly analogous to standard OLS regression elementwise on the appropriately vectorized adjacency matrices of the networks involved. In particular, the network regression attempts to fit the model:$$\mathbf{A_y} = b_0 \mathbf{A_1} + b_1 \mathbf{A_{x_1}} + b_2 \mathbf{A_{x_2}} + \dots + \mathbf{Z}$$
where $A_y$ is the dependent adjacency matrix, $A_xi$ is the ith independent adjacency matrix, $A_1$ is an n x n matrix of 1's, and $Z$ is an n x n matrix of independent normal random variables with mean 0 and variance $sigma^2$. Clearly, this model is nonoptimal when $A_y$ is dichotomous (or, for that matter, categorical in general); an alternative such as netlogit
should be employed in such cases. (Note that netlm
will still attempt to fit such data...the user should consider him or herself to have been warned.)
Because of the frequent presence of row/column/block autocorrelation in network data, classical hull hypothesis tests (and associated standard errors) are generally suspect. Further, it is sometimes of interest to compare fitted parameter values to those arising from various baseline models (e.g., uniform random graphs conditional on certain observed statistics). The tests supported by netlm
are as follows:
classical
cug
cugtest
) controlling for order.
cugden
cugtie
qap
qaptest
); currently identical to qapspp
.
qapallx
qapspp
qapx
qapy
The statistic to be employed in the above tests may be selected via test.statistic
. By default, the $t$-statistic (rather than estimated coefficient) is used, as this is more approximately pivotal; coefficient-based tests are not recommended for QAP null hypotheses, although they are provided here for legacy purposes.
Note that interpretation of quantiles for single coefficients can be complex in the presence of multicollinearity or third variable effects. qapspp
is generally recommended for most multivariable analyses, as it is known to be fairly robust to these conditions. Reasonable printing and summarizing of netlm
objects is provided by print.netlm
and summary.netlm
, respectively. No plot methods exist at this time, alas.
Dekker, D.; Krackhardt, D.; Snijders, T.A.B. (2003). Mulicollinearity Robust QAP for Multiple Regression. CASOS Working Paper, Carnegie Mellon University.
Krackhardt, D. (1987). QAP Partialling as a Test of Spuriousness. Social Networks, 9 171-186.
Krackhardt, D. (1988). Predicting With Networks: Nonparametric Multiple Regression Analyses of Dyadic Data. Social Networks, 10, 359-382.
lm
, netlogit
#Create some input graphs
x<-rgraph(20,4)
#Create a response structure
y<-x[1,,]+4*x[2,,]+2*x[3,,] #Note that the fourth graph is unrelated
#Fit a netlm model
nl<-netlm(y,x,reps=100)
#Examine the results
summary(nl)
Run the code above in your browser using DataLab