pred | R Documentation |
Computes the predicted frequencies for a specified model, given the observed data and
maximum count value. This function supports models estimated using oneinfl
or truncreg
.
pred(model, df, maxpred)
model |
A fitted model object, either a one-inflated model (class |
df |
A data frame containing the variables used in the model. |
maxpred |
Optional. The maximum count value for which predictions are generated.
Defaults to the maximum observed count in |
The function computes predicted frequencies based on the type of model and its distribution:
PP (Poisson, zero-truncated): Computes predictions for a zero-truncated Poisson model.
ZTNB (Negative Binomial, zero-truncated): Computes predictions for a zero-truncated negative binomial model.
OIPP (Poisson, one-inflated): Computes predictions for a one-inflated Poisson model.
OIZTNB (Negative Binomial, one-inflated, zero-truncated): Computes predictions for a one-inflated, zero-truncated negative binomial model.
The predictions are generated for count values from 1 to maxpred
. For one-inflated
models, the predictions account for the one-inflation probabilities.
This is an internal function primarily used by oneplot
for visualization purposes.
A numeric vector of predicted frequencies for count values from 1 to maxpred
.
oneplot
for visualizing observed and predicted frequencies.
oneinfl
for fitting one-inflated models.
truncreg
for fitting zero-truncated models.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.