# influence.ivreg

0th

Percentile

##### Deletion and Other Diagnostic Methods for "ivreg" Objects

Methods for computing deletion and other regression diagnostics for 2SLS regression. It's generally more efficient to compute the deletion diagnostics via the influence method and then to extract the various specific diagnostics with the methods for "influence.ivreg" 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 method 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.

For additional information, see the vignette Diagnostics for 2SLS Regression.

##### Usage
# S3 method for ivreg
influence(
model,
sigma. = n <= 1000,="" type="c("stage2"," "both",="" "maximum"),="" applyfun="NULL," ncores="NULL," ...="" )<="" p=""># S3 method for ivreg
rstudent(model, ...)# S3 method for ivreg
cooks.distance(model, ...)# S3 method for influence.ivreg
dfbeta(model, ...)# S3 method for ivreg
dfbeta(model, ...)# S3 method for ivreg
hatvalues(model, type = c("stage2", "both", "maximum"), ...)# S3 method for influence.ivreg
rstudent(model, ...)# S3 method for influence.ivreg
hatvalues(model, ...)# S3 method for influence.ivreg
cooks.distance(model, ...)# S3 method for influence.ivreg
qqPlot(
x,
ylab = paste("Studentized Residuals(", deparse(substitute(x)), ")", sep = ""),
distribution = c("t", "norm"),
...
)# S3 method for ivreg
influencePlot(x, ...)# S3 method for influence.ivreg
influencePlot(model, ...)# S3 method for ivreg
infIndexPlot(model, ...)# S3 method for influence.ivreg
infIndexPlot(model, ...)# S3 method for influence.ivreg
model.matrix(object, ...)# S3 method for ivreg
avPlots(model, terms, ...)# S3 method for ivreg
avPlot(model, ...)# S3 method for ivreg
mcPlots(model, terms, ...)# S3 method for ivreg
mcPlot(model, ...)# S3 method for ivreg
Boot(
object,
f = coef,
labels = names(f(object)),
R = 999,
method = "case",
ncores = 1,
...
)# S3 method for ivreg
crPlots(model, terms, ...)# S3 method for ivreg
crPlot(model, ...)# S3 method for ivreg
ceresPlots(model, terms, ...)# S3 method for ivreg
ceresPlot(model, ...)# S3 method for ivreg
plot(x, ...)# S3 method for ivreg
qqPlot(x, distribution = c("t", "norm"), ...)# S3 method for ivreg
outlierTest(x, ...)# S3 method for ivreg
influencePlot(x, ...)# S3 method for ivreg
ncvTest(model, ...)# S3 method for ivreg
deviance(object, ...)
##### Arguments
model, x, object

A "ivreg" or "influence.ivreg" 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.

applyfun

Optional loop replacement function that should work like lapply with arguments function(X, FUN, ...). The default is to use a loop unless the ncores argument is specified (see below).

ncores

Numeric, number of cores to be used in parallel computations. If set to an integer the applyfun is set to use either parLapply (on Windows) or mclapply mclapply (otherwise) with the desired number of cores.

...

arguments to be passed down.

ylab

The vertical axis label.

distribution

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

terms

Terms for which added-variable plots are to be constructed; the default, if the argument isn't specified, is the "regressors" component of the model formula.

f, labels, R

see Boot.

method

only "case" (case resampling) is supported: see Boot.

main

Main title for the graph.

##### Value

In the case of influence.ivreg, an object of class "influence.ivreg" 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.ivreg or rstudent.influence.ivreg, the corresponding diagnostic statistics. Many other methods (e.g., crPlot.ivreg, avPlot.ivreg, Effect.ivreg) draw graphs.

ivreg, avPlots, crPlots, predictorEffects, qqPlot, influencePlot, infIndexPlot, Boot, outlierTest, spreadLevelPlot, ncvTest.

##### Aliases
• influence.ivreg
• ivregDiagnostics
• rstudent.ivreg
• cooks.distance.ivreg
• dfbeta.influence.ivreg
• hatvalues.ivreg
• rstudent.influence.ivreg
• hatvalues.influence.ivreg
• cooks.distance.influence.ivreg
• qqPlot.ivreg
• qqPlot.influence.ivreg
• influencePlot.ivreg
• influencePlot.influence.ivreg
• infIndexPlot.ivreg
• infIndexPlot.influence.ivreg
• model.matrix.influence.ivreg
• avPlots.ivreg
• avPlot.ivreg
• mcPlots.ivreg
• mcPlot.ivreg
• Boot.ivreg
• crPlots.ivreg
• crPlot.ivreg
• ceresPlots.ivreg
• ceresPlot.ivreg
• plot.ivreg
• outlierTest.ivreg
• ncvTest.ivreg
• deviance.ivreg
• dfbeta.ivreg
##### Examples
# NOT RUN {
kmenta.eq1 <- ivreg(Q ~ P + D | D + F + A, data = Kmenta)
summary(kmenta.eq1)
car::avPlots(kmenta.eq1)
car::mcPlots(kmenta.eq1)
car::crPlots(kmenta.eq1)
car::ceresPlots(kmenta.eq1)
car::influencePlot(kmenta.eq1)
car::influenceIndexPlot(kmenta.eq1)
car::qqPlot(kmenta.eq1)