Use t-distribution for coefplot
/iplot
CIs
#408
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Almost all of the dedicated fixest methods that yield confidence intervals do so using a t-distribution. (See also #362 (comment).) A notable exception can be found in the
coefplot
/iplot
functions, which currently use a normal distribution:fixest/R/coefplot.R
Lines 1660 to 1661 in d8fb28a
The importance of this difference obviously diminishes with the size of the dataset (since DoF -> Inf). But it does create an awkward situation where the figures from
coefplot
/iplot
don't necessarily correspond to the results from, say,etable
.This PR brings the CIs from
coefplot
andiplot
into alignment with the other fixest methods. I've tried to include some catches so that, if it can't extract the right DoF from the model object for some reason, it will default to Inf and thus effectively revert back to a normal distribution.Here is the current behaviour (fixest 0.11.1):
Created on 2023-04-02 with reprex v2.0.2
And the same code following this PR:
Created on 2023-04-02 with reprex v2.0.2