| QR | R Documentation |
Estimates the user-specified quantile for continuous covariates and the mean of covariates for subjects within the always-survivor principal stratum.
QR(data, prin_fo, quantile_level = 0.5)
data |
Data prepared by |
prin_fo |
principal score model formula |
quantile_level |
One or more quantiles to estimate, expressed as
probabilities strictly between |
QR() uses estimated survival probabilities under treatment 0 to weight
the numeric variables listed in interest_vars. It reports a weighted mean
for every variable. For variables with more than two observed values, it also
reports the requested weighted quantiles. Variables with no more than two
observed values are treated as binary and receive a mean but no quantile.
A QR object containing the weighted means, requested quantiles,
variable-type indicators, and weights. Reported means and quantiles are
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)
result <- QR(
pd_dat,
S ~ X1 + X2 + X4 + A + time,
quantile_level = c(0.25, 0.5, 0.75)
)
result$mean
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.