View source: R/ZIPLNfit-S3methods.R
predict.ZIPLNfit | R Documentation |
Predict counts of a new sample
## S3 method for class 'ZIPLNfit'
predict(
object,
newdata,
responses = NULL,
level = 1,
type = c("link", "response", "deflated"),
...
)
object |
an R6 object with class |
newdata |
A data frame in which to look for variables and offsets with which to predict |
responses |
Optional data frame containing the count of the observed variables (matching the names of the provided as data in the PLN function), assuming the interest in in testing the model. |
level |
Optional integer value the level to be used in obtaining the predictions. Level zero corresponds to the population predictions (default if |
type |
Scale used for the prediction. Either |
... |
additional parameters for S3 compatibility. Not used |
Note that level = 1
can only be used if responses are provided,
as the variational parameters can't be estimated otherwise. In the absence of responses, level
is ignored and the fitted values are returned
Note also that when type = "response"
corresponds to predicting
values with (1 - \pi)A
, where A
is the average count in
the PLN part of the model and \pi
the probability of zero-inflation,
whereas type = "deflated"
corresponds to A
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.