# Plot Diagnostics for objects of class glmmNPML or glmmGQ

### Description

The functions `alldist`

and `allvc`

produce
objects of type `glmmGQ`

, if Gaussian quadrature (Hinde, 1982,
`random.distribution="gq"`

) was applied for computation, and objects
of class `glmmNPML`

, if parameter estimation was carried out by nonparametric
maximum likelihood (Aitkin, 1996a, `random.distribution="np"`

).
The functions presented here give some useful diagnostic plotting functionalities
to analyze these objects.

### Usage

1 2 3 4 |

### Arguments

`x` |
a fitted object of class |

`plot.opt` |
an integer with values |

`noformat` |
if |

`...` |
further arguments which will mostly not have any effect
(and are included only to ensure compatibility with the
generic |

### Details

See the help pages to alldist and the vignette (Einbeck & Hinde, 2007).
It is sufficient to write `plot`

instead of `plot.glmmNPML`

or `plot.glmmGQ`

,
since the generic `plot`

function provided in **R** automatically selects the right model class.

### Value

For class `glmmNPML`

: Depending on the choice of `plot.opt`

, a subset
of the following four plots:

`1` |
Disparity trend. |

`2` |
EM Trajectories. |

`3` |
Empirical Bayes Predictions against observed response. |

`4` |
Individual posterior probabilities. |

The number given in `plot.opt`

is transformed into a binary
number indicating which plots are to be selected. The first digit
(from the right!) refers to plot 1, the second one to plot 2, and so on.
For example, `plot.opt=4`

gives the binary number 0100 and hence selects
just plot 3.

For class `glmmGQ`

: Depending on the choice of plot.opt,
a subset of plots 1 and 3. Again, the number is transformed into binary coding, yielding only the
disparity trend for `plot.opt=1`

, only the EBP's for `plot.opt=2`

,
and both plots for `plot.opt=3`

.

### Author(s)

Jochen Einbeck and John Hinde (2007)

### References

Aitkin, M. (1996a). A general maximum likelihood analysis of overdispersion in generalized linear models. Statistics and Computing 6, 251-262.

Einbeck, J., and Hinde, J.: Nonparametric maximum likelihood estimation for random effect models in R. Vignette to R package npmlreg.
Type `vignette("npmlreg-v")`

to open it.

Hinde, J. (1982). Compound Poisson regression models. Lecture Notes in Statistics 14, 109-121.

### See Also

`alldist`

, `allvc`

### Examples

1 2 3 4 5 6 7 8 | ```
data(galaxies, package="MASS")
gal<-as.data.frame(galaxies)
galaxy.np4u <- alldist(galaxies/1000~1,random=~1,k=4,tol=0.5,data=gal,lambda=1)
predict(galaxy.np4u, type="response") # EBP on scale of responses
plot(galaxy.np4u, plot.opt=4) # plots only EBP vs. response
plot(galaxy.np4u, plot.opt=3) # gives same output as given by default when executing alldist
plot(galaxy.np4u) # gives all four plots.
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.