genmodel function

Generating Model Structure

Generating Model Structure

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 )

Arguments

  • data: A data frame containing all relevant variables.
  • dep: A string with the name of the independent variable or a column number.
  • indep: 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.
  • fixed: 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.
  • cluster: 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.
  • selectobs: Optional. A vector indicating which observations to use.

Returns

A list with four elements:

  • y: y vector.
  • x: x matrix.
  • fes: list of fixed effects.
  • cluster: cluster vector.
  • Maintainer: Joao Cruz
  • License: MIT + file LICENSE
  • Last published: 2025-02-08