update.felm: Update a fitted 'felm' model

View source: R/generics_formula.R

update.felmR Documentation

Update a fitted felm model

Description

S3 method for update() that understands the |-separated formula syntax used by felm(). R's built-in stats::update.formula() breaks on these formulas because the | parts look like factor arithmetic. This method uses the Formula::update.Formula() method which correctly handles multi-part formulas.

The . placeholder works as usual:

  • . ~ . - keep the current response and RHS regressors.

  • The second | segment replaces (or keeps, if .) the fixed-effects.

  • The third | segment replaces (or keeps, if .) the cluster variables.

Usage

## S3 method for class 'felm'
update(object, formula. = . ~ ., vcov = NULL, ...)

Arguments

object

A fitted felm object.

formula.

Update formula; only the segments you want to change need to differ from .. Examples:

  • . ~ . | country + year - change FE, keep regressors.

  • . ~ . | . | ctry1 + ctry2 - keep FE, change cluster.

  • . ~ . - bothin | year - drop a regressor, keep FE.

vcov

Optional new vcov value (e.g. "cluster"). If omitted the original value is reused.

...

Additional arguments forwarded to felm().

Value

A refitted felm object.


capybara documentation built on June 15, 2026, 9:10 a.m.