This function creates the design matrix for a latent network structure using a balanced panel
netdat(datf, Y, X, Wi, W = NULL, panvar, tvar, factors, scaling = TRUE,
unicons = TRUE)
the entire data frame of balanced panel with NT rows of unit-time observations
dependent variable in the data frame datf
the covariate(s) generating spillovers
other unit-varying (can be time-invariant) control variables
global variables. these are only time varying but are common to all units. eg. GDP for individual/state-level data. Note that W has to be a vector of length T so cannot be in the data frame datf
the panel variable eg. unique person/firm identifiers
time variable, eg. years
a vector of characters of factors in the data
a logical indicating whether non-discrete covariates should be scaled by their standard deviations
a logical indicating whether to include unit-specific constant term
Y vector of dependent variables
X a block matrix of spillover matrix (\(TN\) x \(N^2\) )
Wm a matrix corresponding to covariate Wi
Wf a matrix of dummies corresponding to factors