Description Usage Arguments Details Value See Also Examples
View source: R/2_diagnostic_functions.R
Function to obtain various predictions based on the fitted mixed Poisson regression models.
1 2 3 4 5 6 7 8 9 10 11 12 |
object |
object of class "mixpoissonreg" containing results from the fitted model. |
newdata |
optionally, a data frame in which to look for variables with which to predict. If omitted, the fitted response values will be provided. |
type |
the type of prediction. The default is the "response" type, which provided the estimated values for the means. The type "link" provides the estimates for the linear predictor. The type "precision" provides estimates for the precision parameters whereas the type "variance" provides estimates for the variances. |
se.fit |
logical switch indicating if standard errors on the scale of linear predictors should be returned. If |
interval |
Type of interval calculation for the response variables, 'none', 'confidence' or 'prediction'. If 'confidence', the confidence intervals for the means are returned.
If 'prediction', prediction intervals for future response variables are reported. For confidence intervals, the type of the prediction must be 'response' or 'link'.
For prediction intervals the type of prediction must be 'response'. For 'confidence' intervals, when using |
level |
Tolerance/confidence level. The default is set to 0.95. |
nsim_pred |
number of means and predictions to be generated in each step of the simulation. The default is set to 100. |
nsim_pred_y |
number of response variables generated for each pair of mean and precision to compute the prediction intervals. The default is set to 100. |
... |
further arguments passed to or from other methods. |
The se.fit
argument only returns a non-NA vector for type = 'link', that is, on the scale of the linear predictor for the mean parameter. For the response scale,
one can obtain confidence or prediction intervals. It is important to notice that confidence intervals must not be used for future observations as they will underestimate
the uncertainty. In this case prediction intervals should be used. Currently, we do not have closed-form expressions for the prediction interval and, therefore, they
are obtained by simulation and can be computationally-intensive.
A vector containing the predicted values if se.fit=FALSE
, a list with
elements fit and se.fit if se.fit=TRUE
, and a matrix if interval
is set to confidence or prediction.
fitted.mixpoissonreg
, summary.mixpoissonreg
, plot.mixpoissonreg
, autoplot.mixpoissonreg
,
coef.mixpoissonreg
, vcov.mixpoissonreg
,
plot.mixpoissonreg
1 2 | daysabs_prog <- mixpoissonreg(daysabs ~ prog, data = Attendance)
predict(daysabs_prog)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.