dfBetas: Return DFBetas or DFBeta values

Description Usage Arguments See Also Examples

View source: R/dfBetas.R

Description

Simple function to produce a listing of all DFBetas (or DFBeta) values for the coefficients in a lm() object. Observations to investigate (tagged as Investigate) are row sums of absolute coefficients greater than 2 / sqrt(N). Only observations with a Investigte value of 1 or greater are printed by default.

Usage

1
2
3
4
5
6
7
dfBetas(
  obj,
  key.variable = NULL,
  sort.obs = FALSE,
  standardize = TRUE,
  truncate = TRUE
)

Arguments

obj

Object from an lm() fiitted equation.

key.variable

Required if lm() data object is of tibble class. Name of the unique key variable (identifier variable). If data object is of data.frame class, this is optional and row.names will be used instead.

sort.obs

Logical: Should the returned dataframe be sorted by the number of tagged coefficients?

standardize

Logicial: Should standardized DFBeta values (DFBetas) be returned in the dataframe?

truncate

Logical: Should the output be truncated to show ONLY observations that meet the cut-off standardized difference betas of 2/sqrt(N) (the default) or ALL observations in the model?

See Also

studResidPlot levPlot cooksPlot threeOuts

Examples

1
2
3
mod <- lm(hp ~ disp, data=mtcars)
summary(mod)
dfBetas(mod)

MichaelJMahometa/SDSRegressionR documentation built on March 3, 2021, 10:51 p.m.