compute_fes function

Fixed Effects Computation

Fixed Effects Computation

This function is a helper for xvalidate that computes FEs using PPML First Order Conditions (FOCs).

compute_fes( y, fes, x, b, insample_obs = rep(1, n), onlymus = FALSE, tol = 1e-08, verbose = FALSE )

Arguments

  • y: Dependent variable (a vector).
  • fes: List of fixed effects.
  • x: Regressor matrix.
  • b: A vector of coefficient estimates.
  • insample_obs: Vector of observations used to estimate the b coefficients..
  • onlymus: Logical. If TRUE, returns only the conditional means.
  • tol: A tolerance parameter.
  • verbose: Logical. If TRUE, prints messages to the console while evaluating.

Returns

If onlymus = TRUE, the vector of conditional means. Otherwise, a list with two elements:

  • mu: conditional means.
  • fe_values: fixed effects.
  • Maintainer: Joao Cruz
  • License: MIT + file LICENSE
  • Last published: 2025-02-08