genmodel
transforms a data frame into the needed components for our main functions (a y vector,
a x matrix and a fes list).
genmodel(
data,
dep = NULL,
indep = NULL,
fixed = NULL,
cluster = NULL,
selectobs = NULL
)
A list with four elements:
y
: y vector.
x
: x matrix.
fes
: list of fixed effects.
cluster
: cluster vector.
A data frame containing all relevant variables.
A string with the name of the independent variable or a column number.
A vector with the names or column numbers of the regressors. If left unspecified, all remaining variables (excluding fixed effects) are included in the regressor matrix.
A vector with the names or column numbers of factor variables identifying the fixed effects,
or a list with the desired interactions between variables in data
.
Optional. A string with the name of the clustering variable or a column number. It's also possible to input a vector with several variables, in which case the interaction of all of them is taken as the clustering variable.
Optional. A vector indicating which observations to use.