vnet {netregR} | R Documentation |
Variance computation for linear regression of network response
Description
Stand-alone estimation of exchangeable variance matrix based on residuals and design matrix.
Usage
vnet(e = NULL, X = NULL, directed = TRUE, nodes = NULL,
type = "exchangeable", tmax = 1, fit = NULL)
Arguments
e |
Optional vector of residuals, of length |
X |
Optional matrix of covariates from regression, must have |
directed |
Optional logical indicator of whether input data is for a directed network, default is |
nodes |
Optional |
type |
Optional string indicating whether the ‘meat’ in the sandwich variance estimator is estimated using exchangeable theory (see Marrs et. al. (2017)) or using dyadic clustering (Fafchamps and Gubert (2007)). |
tmax |
Optional numeric of third dimension of relational data array, default is |
fit |
Optional fitted model object. One of either |
Details
This function takes X
and e
values computes the variance-covariance matrix of \hat{\beta}
that resulted in the residuals e = Y - X \hat{\beta}
assuming that the errors are exchangeable, as based on Marrs et. al. (2017) when type = "exchangeable"
. When type = "dyadic clustering"
, the theory from Fafchamps and Gubert (2007) is implemented.
Value
A an object of class vhat
containing summary information:
vhat |
Estimated variance-covariance matrix of cofficient estimates |
phi |
Vector of variance-covariance parameter estimates. |
corrected |
Logical of whether variance-covariance matrix was corrected from negative definite to positive semi-definite. |
type |
See inputs. |
tmax |
See inputs. |
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.
Fafchamps, M., & Gubert, F. (2007). Risk sharing and network formation. American Economic Review, 97(2), 75-79.
See Also
Examples
set.seed(1)
n <- 10
d <- n*(n-1)
X <- cbind(1, rnorm(d), sample(c(0,1), d, replace=TRUE))
e <- rnorm(d)
vnet(e=e,X=X)