netlogit
performs a logistic regression of the network variable in y
on the network variables in stack x
. The resulting fits (and coefficients) are then tested against the indicated null hypothesis.netlogit(y, x, mode="digraph", diag=FALSE, nullhyp="cugtie",
reps=1000)
NA
s are allowed, and the data should be dichotomous.NA
s are permitted, as is dichotomous data.mode
is set to "digraph" by default.diag
is FALSE
by default.cugtest
) controlling for order only; "netlogit
netlogit
is primarily a front-end to the built-in glm
routine. netlogit
handles vectorization, sets up glm
options, and deals with null hypothesis testing; the actual fitting is taken care of by glm
. Logistic network regression using is directly analogous to standard logistic regression elementwise on the appropriately vectorized adjacency matrices of the networks involved. As such, it is often a more appropriate model for fitting dichotomous response networks than is linear network regression.
Null hypothesis tests for logistic 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 netlogit
objects is provided by print.netlogit
and summary.netlogit
, respectively. No plot methods exist at this time.
glm
, netlm
#Create a response structure y.l<-x[1,,]+4*x[2,,]+2*x[3,,] #Note that the fourth graph is #unrelated y.p<-apply(y.l,c(1,2),function(a){1/(1+exp(-a))}) y<-rgraph(20,tprob=y.p)
#Fit a netlogit model nl<-netlogit(y,x,reps=100)
#Examine the results
summary(nl)