| PrinPred | R Documentation |
Fits the principal score model and returns each row's estimated probability
of surviving from baseline through its observed time under treatment a.
All observed times from baseline through cutoff are used, and the model is
fitted again each time the function is called.
PrinPred(prin_fo, fit_dat, pred_dat, a, mapping, ...)
prin_fo |
principal score model formula |
fit_dat |
A data frame containing the observations used to fit the model. |
pred_dat |
A data frame containing the observations for which cumulative survival probabilities are requested. |
a |
The treatment level under which survival probabilities are
predicted, either |
mapping |
A |
... |
Additional arguments passed to |
When the data contain multiple times, each post-baseline observation is used to model the next survival step only if the subject was alive at the previous observed time. If the data contain only one observed time, all complete observations at that time are used.
A numeric vector of cumulative survival probabilities, one for each
row of pred_dat, rounded to three decimal places.
data("BiSample", package = "PDRobust")
map <- Mapping(
id = "id", time = "time", treatment = "A",
survival = "S", outcome = "Y",
baseline_time = 0, cutoff_time = 2,
covariates = c("X1", "X2", "X4"),
interest_vars = c("X1", "X2"), y_type = "B"
)
pd_dat <- DataStandard(BiSample, map)
score0 <- PrinPred(
S ~ X1 + X2 + X4 + A + time,
pd_dat, pd_dat, a = 0, mapping = map
)
head(score0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.