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, mode="digraph", diag=FALSE, nullhyp="cugtie", reps=1000)
mode
is set to "digraph" by default.Diag
is FALSE
by default.cugtest
) controlling for order only; "netlm
netlm
is really a front-end to the built-in lm
routine. netlm
handles vectorization and null hypothesis testing; the actual fitting is taken care of by lm
. 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 $\mathbf{A_y}$ is the dependent adjacency matrix, $\mathbf{A_{x_i}}$ is the ith independent adjacency matrix, $\mathbf{A_1}$ is an n x n matrix of 1's, and $\mathbf{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 $\mathbf{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.)
Null hypothesis tests for the network regression are handled using either the conditional uniform graph hypothesis (the default) or QAP. See the help pages for these tests for a fuller description of each. Reasonable printing and summarizing of netlm
objects is provided by print.netlm
and summary.netlm
, respectively. No plot methods exist at this time, alas.
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