Learn R Programming

fitPS (version 1.0.1)

predict.psFit: S3 predict method for an object of class psFit

Description

S3 predict method for an object of class psFit

Usage

# S3 method for psFit
predict(
  object,
  newdata,
  interval = c("none", "prof", "wald"),
  level = 0.95,
  ...
)

Value

either a named vector of fitted probabilities, or a data.frame

with columns predicted, lower, and upper and the row names set to show what terms are being calculatd

Arguments

object

an object of class psFit, usually from fitDist or fitZIDist.

newdata

an optional vector of integers at which to calculate \(\Pr(X = x)\).

interval

either "none", "prof", or "wald" and can be abbreviated. If "prof" or "wald" AND the zeta model has been used then an interval, based on the bounds of a 100 * level confidence interval for the shape parameter, is given for each predicted probability. The interval is provided based on either a Profile Likelihood, or a Wald, confidence interval for the shape, and therefore cannot really be regarded as a confidence interval for the probabilities. The intervals might be more sensibly regarded as a measure of how sensitive the probabilities are to the choice of shape parameter. NOTE: this parameter is ignored if the Zero-inflated (ZIZ) model has been used.

level

the level of a confidence interval. Ignored if interval == "none".

...

other arguments passed to predict---not used

Examples

Run this code
data(Psurveys)
roux = Psurveys$roux
fit = fitDist(roux)
predict(fit, interval = "prof")

Run the code above in your browser using DataLab