wald() and pvalue()/coeftable() use different reference distributions for Poisson models
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 47/100
Research direction
Start by tracing how wald(), pvalue(), and coeftable() choose reference distributions for fepois and feglm, then check the change in 0.14.0 associated with #634. Reproduce the mismatch with the supplied example and compare the Poisson result with feols; done when the methods use a consistent rule and regression coverage confirms their p-values agree for a single-coefficient test.
Written by the indexing model from the issue text.
Description
Hi!
I found a small inconsistency: for fepois models (and presumably feglm with a binomial family), wald() and the coefficient-level inference (pvalue(), coeftable(), confint()) use different reference distributions. As a result, the same single-coefficient hypothesis gets very different p-values. For feols the two agree.
library(fixest)
data(trade)
gravity_ols <- feols(
Euros ~ log(dist_km) |
Origin + Destination + Product + Year,
cluster = ~ Origin + Destination,
trade
)
fixest::pvalue(gravity_ols)
#> log(dist_km)
#> 0.001241529
#> attr(,"vcov_type")
#> [1] "Clustered (Origin & Destination)"
fixest::wald(gravity_ols)
#> Wald test, H0: nullity of log(dist_km)
#> stat = 16.2, p-value = 0.001242, on 1 and 14 DoF, VCOV: Clustered (Origin & Destination).
gravity_pois <- fepois(
Euros ~ log(dist_km) |
Origin + Destination + Product + Year,
cluster = ~ Origin + Destination,
trade
)
fixest::pvalue(gravity_pois)
#> log(dist_km)
#> 1.486652e-31
#> attr(,"vcov_type")
#> [1] "Clustered (Origin & Destination)"
fixest::wald(gravity_pois)
#> Wald test, H0: nullity of log(dist_km)
#> stat = 136.6, p-value = 1.312e-8, on 1 and 14 DoF, VCOV: Clustered (Origin & Destination).
print(packageVersion("fixest"))
#> [1] '0.14.2'
Created on 2026-10-27 with reprex v2.1.1
For OLS, both use t(G_min − 1) = t(14), so the F(1, 14) Wald p-value equals the t-test p-value. For Poisson:
pvalue()uses the normal distribution, sinceuse_t_distr()returnsFALSEfor the poisson/binomial families.wald()uses F(q, df.t) withdf.t = G_min − 1regardless of the family.
If I read the code and NEWS correctly, this started in 0.14.0, when wald() began using the effective sample size (#634).
I'm not sure which behaviour is intended. Either way, it would help if wald() and the coefficient table followed the same rule for a given model.
Thanks for clarifying!
- Dominant language
- R
- Stars
- 464
- Forks
- 82
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 12
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lrberge/fixest
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
lrberge/fixest#686 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
lrberge/fixest#713 · 1 comment ·
Maintainers usually reply within 1 day
-
etable notes spacingOpen
Difficulty 3/5 Half a day Newbie friendliness 50/100
Maintainers usually reply within 1 day
-
`model.matrix()` ignores the estimation reference for bare `i()` on new dataPossibly taken @soodoku claimed this 12 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug dependencies R
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
enhancement needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
JamesHWade/graft#142 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100