influence.2sls: Deletion Diagnostic Methods for '"2sls"' Objects

Description Usage Arguments Value See Also Examples

View source: R/influence.2sls.R

Description

Methods for computing deletion diagnostics for 2SLS regression. It's generally more efficient to compute the diagnostics via the influence method and then to extract the various specific diagnostics with the methods for "influence.2sls" objects. Other diagnostics for linear models, such as added-variable plots (avPlots) and component-plus-residual plots (crPlots), also work, as do effect plots (e.g., predictorEffects) with residuals (see the examples below). The pointwise confidence envelope for the qqPlot methods assumes an independent random sample from the t distribution with degrees of freedom equal to the residual degrees of freedom for the model and so are approximate, because the studentized residuals aren't independent.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
## S3 method for class '2sls'
influence(model, sigma. = n <= 1000, type = c("stage2",
  "both"), ...)

## S3 method for class '2sls'
rstudent(model, ...)

## S3 method for class '2sls'
cooks.distance(model, ...)

## S3 method for class 'influence.2sls'
dfbeta(model, ...)

## S3 method for class '2sls'
dfbeta(model, ...)

## S3 method for class '2sls'
hatvalues(model, type = c("stage2", "both", "maximum"),
  ...)

## S3 method for class 'influence.2sls'
rstudent(model, ...)

## S3 method for class 'influence.2sls'
hatvalues(model, ...)

## S3 method for class 'influence.2sls'
cooks.distance(model, ...)

## S3 method for class '2sls'
qqPlot(x, ylab = paste("Studentized Residuals(",
  deparse(substitute(x)), ")", sep = ""), distribution = c("t", "norm"),
  ...)

## S3 method for class 'influence.2sls'
qqPlot(x, ylab = paste("Studentized Residuals(",
  deparse(substitute(x)), ")", sep = ""), distribution = c("t", "norm"),
  ...)

## S3 method for class '2sls'
influencePlot(model, ...)

## S3 method for class 'influence.2sls'
influencePlot(model, ...)

## S3 method for class '2sls'
infIndexPlot(model, ...)

## S3 method for class 'influence.2sls'
infIndexPlot(model, ...)

## S3 method for class 'influence.2sls'
model.matrix(object, ...)

Arguments

model

A "2sls" or "influence.2sls" object.

sigma.

If TRUE (the default for 1000 or fewer cases), the deleted value of the residual standard deviation is computed for each case; if FALSE, the overall residual standard deviation is used to compute other deletion diagnostics.

type

If "stage2" (the default), hatvalues are for the second stage regression; if "both", the hatvalues are the geometric mean of the casewise hatvalues for the two stages; if "maximum", the hatvalues are the larger of the casewise hatvalues for the two stages. In computing the geometric mean or casewise maximum hatvalues, the hatvalues for each stage are first divided by their average (number of coefficients in stage regression/number of cases); the geometric mean or casewise maximum values are then multiplied by the average hatvalue from the second stage.

...

arguments to be passed down.

x

A "2sls" or "influence.2sls" object.

ylab

The vertical axis label.

distribution

"t" (the default) or "norm".

object

An "influence.2sls" object.

Value

In the case of influence.2sls, an object of class "influence.2sls" with the following components:

coefficients

the estimated regression coefficients

model

the model matrix

dfbeta

influence on coefficients

sigma

deleted values of the residual standard deviation

dffits

overall influence on the regression coefficients

cookd

Cook's distances

hatvalues

hatvalues

rstudent

Studentized residuals

df.residual

residual degrees of freedom

In the case of other methods, such as rstudent.2sls or rstudent.influence.2sls, the corresponding diagnostic statistics.

See Also

lm2sls, 2SLS_Methods, avPlots, crPlots, predictorEffects, qqPlot, influencePlot, infIndexPlot

Examples

1
2
3
4
5
6
7
8
9
kmenta.eq1 <- lm2sls(Q ~ P + D, ~ D + F + A, data=Kmenta)
car::avPlots(kmenta.eq1)
car::crPlots(kmenta.eq1)
car::influencePlot(kmenta.eq1)
car::influenceIndexPlot(kmenta.eq1)
car::qqPlot(kmenta.eq1)
if (require(effects)){
  plot(effects::predictorEffects(kmenta.eq1, residuals=TRUE))
}

john-d-fox/lm2sls documentation built on Nov. 4, 2019, 3:05 p.m.