Variance computation for linear regression of network response
Variance computation for linear regression of network response
Stand-alone estimation of exchangeable variance matrix based on residuals and design matrix.
vnet(e =NULL, X =NULL, directed =TRUE, nodes =NULL, type ="exchangeable", tmax =1, fit =NULL)
Arguments
e: Optional vector of residuals, of length d. Column-wise unfolding of adjacency matrix without diagonal entries (self-loops).
X: Optional matrix of covariates from regression, must have d rows.
directed: Optional logical indicator of whether input data is for a directed network, default is TRUE. Undirected data format is lower triangle of adjacencey matrix.
nodes: Optional d×2 matrix indicating the (directed) relation pairs to which each entry in e and each row in X corresponds. If not input, complete network observation is assumed and the size d and directed must correspond to an appropriate network of size n.
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 1, i.e. a relational matrix. Currently only accepts tmax = 1.
fit: Optional fitted model object. One of either fit or the pair (e, X) must be specified. Defaults to fit if both entered. Designed around lmnet' class but may work for others, such as lm'
Returns
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.
Details
This function takes X and e values computes the variance-covariance matrix of β^ that resulted in the residuals e=Y−Xβ^ 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.
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.