Description Usage Arguments Details Value Note Author(s) See Also Examples
Obtains predictions and optionally estimates standard errors of those predictions from a fitted joint mean and dispersion effect model object.
1 2 3 |
object |
a fitted object of class inheriting from " |
newdata |
optionally, a data frame in which to look for variables with which to predict. If omitted, the fitted linear predictors are used. |
type |
the type of prediction required. The default is on the scale of the linear predictors; the alternative " |
se.fit |
logical switch indicating if standard errors are required. |
na.action |
function determining what should be done with missing values in |
... |
further arguments passed to or from other methods. |
If newdata
is omitted the predictions are based on the data used for the fit. In that case how cases with missing values in the original fit is determined by the na.action
argument of that fit. If na.action = na.omit
omitted cases will not appear in the residuals, whereas if na.action = na.exclude
they will appear (in predictions and standard errors), with residual value NA
. See also napredict
.
If se.fit = FALSE
, a vector or matrix of predictions.
If se.fit = TRUE
, a list with components
fit |
Predictions, as for se.fit = FALSE. |
se.fit |
Estimated standard errors. |
Variables are first looked for in newdata
and then searched for in the usual way (which will include the environment of the formula used in the fit). A warning will be given if the variables found are not of the same length as those in newdata
if it was supplied.
Karl Wu Ka Yui (karlwuky@suss.edu.sg)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Example in jmdem(...)
MyData <- simdata.jmdem.sim(mformula = y ~ x, dformula = ~ z,
mfamily = poisson(),
dfamily = Gamma(link = "log"),
beta.true = c(0.5, 4),
lambda.true = c(2.5, 3), n = 100)
fit <- jmdem(mformula = y ~ x, dformula = ~ z, data = MyData,
mfamily = poisson, dfamily = Gamma(link = "log"),
dev.type = "deviance", method = "CG")
## Predict on the scale of the response variable with standard errors.
predict(fit, type = "response", se.fit = TRUE)
## Predict based on a new observation on the scale of the linear
## predictors with standard errors.
predict(fit, newdata = data.frame(x = -1.5, z = 100), se.fit = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.