View source: R/predict.JointFPM.R
predict.JointFPM | R Documentation |
Predicts different estimates from a joint flexible parametric model. Currently only the estimation of the mean number of events at different time points is supported.
## S3 method for class 'JointFPM'
predict(
object,
type = "mean_no",
newdata,
t,
exposed = NULL,
ci_fit = TRUE,
method = "romberg",
ngq = 30,
...
)
object |
A joint flexible parametric model of class |
type |
A character vector defining the estimate of interest. Currently available options are:
|
newdata |
A |
t |
A vector defining the time points used for the prediction. |
exposed |
A function that takes |
ci_fit |
Logical indicator for whether confidence intervals should be estimated for the fitted estimates using the delta method. |
method |
The method used for the underlying numerical integration procedure.
Defaults to |
ngq |
Number of quadrature nodes used when |
... |
Added for compatibility with other predict functions. |
The function required for the exposed
argument must take the newdata
dataset as argument and transform it to a new dataset that defines the
exposed group. Assume we assume that we have a model with one variable
trt
which is a 0/1 coded treatment indicator. If we would like to obtain
the difference in mean number of events comparing the untreated to treated
group we could use the following function assuming that
newdata = data.frame(trt = 0)
:
function(x){transform(x, trt = 1)}
A data.frame
with the following columns:
t
: The time for the prediction,
fit
: The point estimate of the prediction,
lci
: The lower confidence interval limit,
uci
: The upper confidence interval limit.
bldr_model <- JointFPM(Surv(time = start,
time2 = stop,
event = event,
type = 'counting') ~ 1,
re_model = ~ pyridoxine + thiotepa,
ce_model = ~ pyridoxine + thiotepa,
re_indicator = "re",
ce_indicator = "ce",
df_ce = 3,
df_re = 3,
cluster = "id",
data = bladder1_stacked)
predict(bldr_model,
newdata = data.frame(pyridoxine = 1,
thiotepa = 0),
t = c(10, 20),
ci_fit = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.