lrberge / fixest

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

Cook's distance for feglm objects #230

Open pachadotdev opened 3 years ago

pachadotdev commented 3 years ago

Hi

I'm interested in getting this for feglm objects (i.e. quasi-Poisson):

d %>%
  mutate(
    .cooksd = cooks.distance(fit),
    .std.resid = MASS::studres(fit),
    .hat = hatvalues(fit)
  ) %>%
  filter(.std.resid < 2 & .cooksd < 4 / (n - p - 1) & .hat < 2 * p / n)

is this in the roadmap for this pkg?

lrberge commented 2 years ago

Hi! In fact, there are many stats methods that I didn't implement for one reason: they don't play well with fixed-effects. For example the hat-values require a matrix of the size of the number of the fixed-effects and this is often not computationally feasible. But tackling this problem is in the mid term pipeline, so that should be there at some point.