Learn R Programming

lmSupport (version 2.9.13)

modelCaseAnalysis: Provides graphs and/or tests for problematic cases for a linear model

Description

Provides diagnositic graphs and visual cut points for identification of points that are univaraite outliers, high leverage, regression outliers, and/or influential

Usage

modelCaseAnalysis(Model, Type = "RESIDUALS", Term = NULL, ID = row.names(Model$model))

Arguments

Model

a linear model produced by lm.

Type

Type = c('RESIDUALS', 'UNIVARIATE', 'HATVALUES', 'COOKSD', 'DFBETAS', 'INFLUENCEPLOT' 'COVRATIO') RESIDUALS (default) = regression outliers, UNIVARIATE = univariate outliers, HATVALUES = leverage, COOKSD = model influence, DFBETAS= individual parameter influence, INFLUENCEPLOT= leverage X influence, COVRATIO = inflation of SEs.

Term

Term from model to display. Used only by DFBETAS. DEFAULT is NULL with all terms displayed

ID

Use to identify points. Default = row.names(Model$model). NULL = no identification

Value

Side effect of plot is main goal for function. Also returns a list with Rownames and CaseAnalysis Values for cases identified. No list returned if DFBETAS without single term identified.

References

Fox, J. (1991). Regression diagnostics. SAGE Series (79) Quantitative Applictions in the Social Science.

Examples

Run this code
# NOT RUN {
##NOT RUN
##m = lm(FPS~BAC+TA, data=BAC)
##Cases = modelCaseAnalysis(m,'RESIDUALS')
##BAC[Cases$Rownames,]

##modelCaseAnalysis(m,'DFBETAS')
##modelCaseAnalysis(m,'DFBETAS', 'assets')
# }

Run the code above in your browser using DataLab