lrberge / fixest

Fixed-effects estimations
https://lrberge.github.io/fixest/
362 stars 59 forks source link

Wald test for equality of coefficients #387

Closed sonalichowdhry closed 1 year ago

sonalichowdhry commented 1 year ago

Is there a way to run Wald tests on the equality of estimated coefficients?

kennchua commented 1 year ago

As far as I know fixest::wald() only conducts tests of (joint) coefficient nullity.

For other linear (and non-linear) hypothesis tests, I highly recommend the marginaleffects package which is compatible with fixest.

library(fixest)
library(marginaleffects)

reg <- feols(mpg ~ wt + am, data = mtcars)

marginaleffects::hypotheses(reg, "wt = am") # test coef_wt = coef_am
sonalichowdhry commented 1 year ago

Excellent suggestion! Thanks @kennchua.