netlm.grpd: Linear Regression for Network Data with grouped random...

Description Usage Arguments Details Value Examples

View source: R/netlm.grpd.R

Description

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.This is a extention of netlm, as it supports the grouped network permutation. This function is still in the testing phase.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
netlm.grpd(
  y,
  x,
  intercept = TRUE,
  mode = "digraph",
  diag = FALSE,
  grp.ns = NULL,
  nullhyp = c("qap", "qapspp", "qapy", "qapx", "qapallx", "cugtie", "cugden", "cuguman",
    "classical"),
  test.statistic = c("t-value", "beta"),
  tol = 1e-07,
  reps = 1000
)

Arguments

y

dependent network variable. This should be a matrix, for obvious reasons; NAs are allowed, but dichotomous data is strongly discouraged due to the assumptions of the analysis.

x

stack of independent network variables. Note that NAs are permitted, as is dichotomous data.

intercept

logical; should an intercept term be added?

mode

string indicating the type of graph being evaluated. "digraph" indicates that edges should be interpreted as directed; "graph" indicates that edges are undirected. mode is set to "digraph" by default.

diag

logical; should the diagonal be treated as valid data? Set this true if and only if the data can contain loops. diag is FALSE by default.

grp.ns

a vector indicates the number of actors in each group. The default is NULL. A raison d'etre of this extention function.

nullhyp

string indicating the particular null hypothesis against which to test the observed estimands.

test.statistic

string indicating the test statistic to be used for the Monte Carlo procedures.

tol

tolerance parameter for qr.solve.

reps

integer indicating the number of draws to use for quantile estimation. (Relevant to the null hypothesis test only - the analysis itself is unaffected by this parameter.) Note that, as for all Monte Carlo procedures, convergence is slower for more extreme quantiles. By default, reps=1000.

Details

This is the extention of the netlm in the package sna. This function supports the grouped network permutation when calculating the significance level, although currently it support only the method qap and qapspp (they are identical) for such permutation. This function helps for QAP test in which the off-diagonal matrix is set to be NA, for example.

The tests in the nullhyp supported by netlm.grpd are (currently) as follows:

classical: tests based on classical asymptotics.

qap: QAP permutation test; currently identical to qapspp.

qapspp: QAP permutation test, using Dekker's "semi-partialling plus" procedure.

Value

An object of class netlm.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Example
library(sna)
xmat1.1 <- sna::rgraph(100)
xmat1.2 <- sna::rgraph(120)
xmat1 <- list2mat(list(xmat1.1,xmat1.2), fill = NA)

xmat2.1 <- sna::rgraph(100)
xmat2.2 <- sna::rgraph(120)
xmat2 <- list2mat(list(xmat2.1,xmat2.2), fill = NA)

mat.y1 <- sna::rgraph(100)
mat.y2 <- sna::rgraph(120)
ymat <- list2mat(list(mat.y1,mat.y2), fill = NA)

res2.1 <- netlm.grpd(y = ymat, x = list(xmat1, xmat2),
                    grp.ns = c(100,120),reps = 100, nullhyp = "qap")
summary(res2.1)
res2.2 <- netlm.grpd(y = ymat, x = list(xmat1, xmat2),
                     grp.ns = c(100,120),nullhyp = "classical")
summary(res2.2)

huhn1234/vogeltools documentation built on Jan. 17, 2020, 5:21 p.m.