netdat {cluscov}R Documentation

Construct a network design matrix

Description

This function creates the design matrix for a latent network structure using a balanced panel

Usage

netdat(datf, Y, X, Wi, W = NULL, panvar, tvar, factors, scaling = TRUE,
  unicons = TRUE)

Arguments

datf

the entire data frame of balanced panel with NT rows of unit-time observations

Y

dependent variable in the data frame datf

X

the covariate(s) generating spillovers

Wi

other unit-varying (can be time-invariant) control variables

W

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

panvar

the panel variable eg. unique person/firm identifiers

tvar

time variable, eg. years

factors

a vector of characters of factors in the data

scaling

a logical indicating whether non-discrete covariates should be scaled by their standard deviations

unicons

a logical indicating whether to include unit-specific constant term

Value

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


[Package cluscov version 1.1.0 Index]