lmnet {netregR} | R Documentation |
Linear regression for network response
Description
This function takes X
and Y
values and fits the multiple linear regression Y = X \beta + \epsilon
and returns standard errors.
Usage
lmnet(Y, X, directed = TRUE, tmax = 1, nodes = NULL, reweight = FALSE,
type = "exchangeable", tol = 1e-06, maxit = 10000, ndstop = TRUE,
verbose = FALSE)
Arguments
Y |
Vector of relations to be regress, of length |
X |
Matrix of covariates to be regressed upon, including intercept if intercept is desired, must have |
directed |
Optional logical indicator of whether input data is for a directed network, default is |
tmax |
Optional numeric of third dimension of relational data array, default is |
nodes |
Optional |
reweight |
Optional logical indicator of whether iteratively reweighted least squares should be used to compute estimate of |
type |
Optional character specifying degree of exchangeability of third dimension of array (when present, i.e. in temporal relational arrays). Default is |
tol |
Optional numeric, tolerance of stopping criteria of iteratively reweighted least squares estimate of |
maxit |
Optional numeric, maximum number of iterations for iteratively reweighted least squares estimate of |
ndstop |
Optional logical indicator of whether negative definite weighting matrix in iteratively reweighted least squares should stop the descent. Default is |
verbose |
Optional logical indicator of whether information from iteratively reweighted least squares estimate of |
Details
This function takes X
and Y
values and fits the multiple linear regression Y = X \beta + \epsilon
by ordinary least squares or iteratively reweighted least squares as indicated by the input. The covariance structure is exchangeable from that of Marrs et. al. (2017). The standard errors and test statistics are based on the same paper.
The three dimensional relational array case, i.e. temporal relational data, requires a specification of the type of exchangeability in this third dimension. We may assume that different time periods are independent. On the other hand, we might assume each repeated observation is exchangeable (for example decomposing trade networks into sectors of trade: goods vs. services). See Figure 6a of Marrs et. al. (2017) for the exchangeable case and the surrounding discussion for the independent case.
Value
fit |
An |
References
Marrs, F. W., Fosdick, B. K., & McCormick, T. H., (2017). Standard errors for regression on relational data with exchangeable errors. arXiv preprint arXiv:1701.05530.
See Also
Examples
set.seed(1)
n <- 10
d <- n*(n-1)
X <- cbind(1, rnorm(d), sample(c(0,1), d, replace=TRUE))
betatrue <- rep(1,3)
Y <- X %*% betatrue + rnorm(d)
fit <- lmnet(Y,X)
fit
fit2 <- lmnet(Y,X,reweight=TRUE)
fit2