cooks_test | R Documentation |
cooks_test
returns the observations identified
as influential based on the cooks statistics being
larger than a threshold.
The threshold for this
test is the 0.5
quantile of a F_{p, n-p}
distribution
where p =
length(stats::coef(model))
and
n - p =
stats::df.residual(model)
.
cooks_test(model, n = stats::nobs(model))
model |
A fitted model object from the
|
n |
The number of outliers to return. The default is all influential observations. |
A vector of influential observations.
cooks.distance
lmod <- lm(price ~ sqft_living, data = home_sales)
cooks_test(lmod)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.