The two-stage procedure first estimates the centralities then regress the outcome of interest to the estimated centralities and other covariates.

two_stage(A, X, y, r = 1, scaled = 1, weights = rep(1, length(y)), ...)

Arguments

A

The adjacency matrix of the input network

X

The design matrix

y

The response vector

r

The rank of the input adjacency matrix

scaled

Scale \(u\) and \(v\) of norm \(\sqrt{n}\)

weights

The weight vector for each observation in (X,y)

Value

Output a two_stage object

u

The estimated hub centrality

v

The estimated authority centrality

beta

The scaled estimated regression coeffcients

coefficients

The original estimated regression coeffcients without scaling.

residuals

The residuals of the regression

fitted.values

The predicted response

epsa

The estimated \(\sigma_a\)

epsy

The estimated \(\sigma_y\)

A

The adjacency matrix of the input network

X

The input design matrix

y

The input response

method

The estimation method: two_stage

...

Auxiliary output from lm.fit

Examples

n <- 100 p <- 3 sigmaa <- 1 sigmay <- 1e-5 A <- matrix(rnorm(n^2, sd = sigmaa), nrow = n) X <- matrix(rnorm(n*p), nrow = n, ncol = p) y <- rnorm(n, sd = sigmay) ret <- two_stage(A, X, y)