localInfluence.overglm: Local Influence for alternatives to the Poisson and Binomial...

View source: R/overglm3.R

localInfluence.overglmR Documentation

Local Influence for alternatives to the Poisson and Binomial Regression Models under the presence of Overdispersion

Description

Computes local influence measures under the case-weight perturbation scheme for alternatives to the Poisson and Binomial Regression Models under the presence of Overdispersion. Those local influence measures may be chosen to correspond to all parameters in the linear predictor or (via coefs) for just some subset of them.

Usage

## S3 method for class 'overglm'
localInfluence(
  object,
  type = c("total", "local"),
  coefs,
  plot.it = FALSE,
  identify,
  ...
)

Arguments

object

an object of class overglm.

type

an (optional) character string which allows to specify the local influence approach: the absolute value of the elements of the main diagonal of the normal curvature matrix ("total") or the eigenvector which corresponds to the maximum absolute eigenvalue of the normal curvature matrix ("local"). As default, type is set to "total".

coefs

an (optional) character string which (partially) match with the names of some model parameters.

plot.it

an (optional) logical indicating if the plot is required or just the data matrix in which that plot is based. As default, plot.it is set to FALSE.

identify

an (optional) integer indicating the number of individuals to identify on the plot. This is only appropriate if plot.it=TRUE.

...

further arguments passed to or from other methods. If plot.it=TRUE then ... may be used to include graphical parameters to customize the plot. For example, col, pch, cex, main, sub, xlab, ylab.

Value

A matrix as many rows as individuals in the sample and one column with the values of the local influence measure.

References

Cook R.D. (1986) Assessment of Local Influence. Journal of the Royal Statistical Society: Series B (Methodological) 48, 133-155.

Examples

###### Example 1: Self diagnozed ear infections in swimmers
data(swimmers)
fit1 <- overglm(infections ~ frequency + location, family="nb1(log)", data=swimmers)

### Local influence for all parameters in the linear predictor
localInfluence(fit1, type="local", plot.it=TRUE, col="red", lty=1, lwd=1, col.lab="blue",
               col.axis="blue", col.main="black", family="mono", cex=0.8)

### Local influence for the parameter associated with 'frequency'
localInfluence(fit1, type="local", plot.it=TRUE, col="red", lty=1, lwd=1, col.lab="blue",
               coef="frequency", col.axis="blue", col.main="black", family="mono", cex=0.8)

###### Example 2: Article production by graduate students in biochemistry PhD programs
bioChemists <- pscl::bioChemists
fit2 <- overglm(art ~ fem + kid5 + ment, family="nb1(log)", data = bioChemists)

### Local influence for all parameters in the linear predictor
localInfluence(fit2, type="local", plot.it=TRUE, col="red", lty=1, lwd=1, col.lab="blue",
               col.axis="blue", col.main="black", family="mono", cex=0.8)

### Local influence for the parameter associated with 'fem'
localInfluence(fit2, type="local", plot.it=TRUE, col="red", lty=1, lwd=1, col.lab="blue",
               coef="fem", col.axis="blue", col.main="black", family="mono", cex=0.8)

###### Example 3: Agents to stimulate cellular differentiation
data(cellular)
fit3 <- overglm(cbind(cells,200-cells) ~ tnf + ifn, family="bb(logit)", data=cellular)

### Local influence for all parameters in the linear predictor
localInfluence(fit3, type="local", plot.it=TRUE, col="red", lty=1, lwd=1, col.lab="blue",
               col.axis="blue", col.main="black", family="mono", cex=0.8)

### Local influence for the parameter associated with 'tnf'
localInfluence(fit3, type="local", plot.it=TRUE, col="red", lty=1, lwd=1, col.lab="blue",
               coef="tnf", col.axis="blue", col.main="black", family="mono", cex=0.8)


glmtoolbox documentation built on Sept. 11, 2024, 7:32 p.m.