compute_fes: Fixed Effects Computation

View source: R/xvalidate.R

compute_fesR Documentation

Fixed Effects Computation

Description

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

Usage

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.

Value

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

  • mu: conditional means.

  • fe_values: fixed effects.


penppml documentation built on Sept. 8, 2023, 5:58 p.m.