Skip to content

Commit

Permalink
compute cooks distance with influence
Browse files Browse the repository at this point in the history
  • Loading branch information
dramanica committed Jan 11, 2023
1 parent 33400d1 commit f6af2d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pymer4/models/Lmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,8 @@ def cooks_distance(
self,
):
"""
Compute Cook's distance for a Lmer object (this is a wrapper for cooks.distance in lme4).
Compute Cook's distance for a Lmer object. Specifically, we use cooks.distance(influence(x) as discussed in
https://github.com/lme4/lme4/issues/693
Args:
self (Lmer): the Lmer object for which confidence intervals should be computed
Expand All @@ -1708,7 +1709,7 @@ def _f(x):
# Model cooks distances
rstring = """
function(model){
out <- cooks.distance(model)
out <- cooks.distance(influence(model))
out
}
"""
Expand Down

0 comments on commit f6af2d7

Please sign in to comment.