extreme_on_x {MMRcaseselection}R Documentation

Extremeness of cases on an independent variable

Description

Extremeness of a case is calculated by the difference between a case's value on the independent variable and the variable's mean value.

Usage

extreme_on_x(lmobject = NULL, ind_var = NULL)

Arguments

lmobject

Object generated with lm

ind_var

Independent variable for which extremeness values should be calculated. Has to be entered as a character.

Details

Calculating the absolute value of the difference between the cases' values and the variable's mean value is proposed by Seawright, Jason (2016): The Case for Selecting Cases That Are Deviant or Extreme on the Independent Variable. Sociological Methods & Research 45 (3): 493-525. (https://doi.org/10.1177/0049124116643556)

Value

A dataframe with

- all variables in the linear model,

- absolute extremeness (absolute value of difference between variable score and mean value of variable),

- extremeness (difference between variable score and mean value of variable), which can be useful when the direction of extremeness is relevant.

The rows are ordered in decreasing order of the absolute extreme values.

Examples

df <- lm(mpg ~ disp + wt, data = mtcars)
extreme_on_x(df, "wt")


[Package MMRcaseselection version 0.1.0 Index]