| predict.pcdfit | R Documentation |
Predictions from a panel count model
## S3 method for class 'pcdfit'
predict(object, newdata, type = c("lp", "mean"), ...)
object |
A fitted |
newdata |
Data to predict for. Defaults to the data the model was fitted
to. For |
type |
|
... |
Ignored. |
The rate model's predicted mean is non-decreasing in t by construction,
because it integrates a positive quantity. The means model's is not: it is a
fitted \hat\mu(t) rescaled by a covariate value that may itself move up
and down, so a predicted mean count that falls is possible and is the
practical drawback of that model with time-varying covariates.
For type = "lp", a numeric vector with one element per row of
newdata. For type = "mean", a tibble with columns
id, time and mean.
set.seed(1)
d <- sim_pcd(60, beta = c(1, -1), lambda = function(t) 8 / (1 + t))
fit <- pcdreg(pcd(id, tstart, tstop, count) ~ x1 + x2, data = d)
head(predict(fit))
head(predict(fit, type = "mean"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.