Skip to content

Commit

Permalink
add cooksdistance (JuliaLang#679)
Browse files Browse the repository at this point in the history
Originate from the addition of the cooksdistance in GLM.jl for LinearModel.
Discussed in JuliaStats/GLM.jl#415
  • Loading branch information
ericqu committed Apr 7, 2021
1 parent bc20566 commit f2a067a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StatsBase"
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
authors = ["JuliaStats"]
version = "0.33.4"
version = "0.33.5"

[deps]
DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
Expand Down
1 change: 1 addition & 0 deletions docs/src/statmodels.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ crossmodelmatrix
dof_residual
fitted
leverage
cooksdistance
meanresponse
modelmatrix
response
Expand Down
9 changes: 9 additions & 0 deletions src/statmodels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,15 @@ Return the diagonal of the projection matrix of the model.
"""
leverage(model::RegressionModel) = error("leverage is not defined for $(typeof(model)).")

"""
cooksdistance(model::RegressionModel)
Compute [Cook's distance](https://en.wikipedia.org/wiki/Cook%27s_distance)
for each observation in linear model `model`, giving an estimate of the influence
of each data point.
"""
cooksdistance(model::RegressionModel) = error("cooksdistance is not defined for $(typeof(model)).")

"""
residuals(model::RegressionModel)
Expand Down

0 comments on commit f2a067a

Please sign in to comment.