| PSPred | R Documentation |
Fits a logistic model using baseline observations from fit_dat and returns
each row's estimated probability of receiving treatment 1 in pred_dat.
The model is fitted again each time the function is called.
PSPred(ps_fo, fit_dat, pred_dat, mapping, ...)
ps_fo |
propensity score model formula |
fit_dat |
A data frame containing the baseline observations used to fit the model. |
pred_dat |
A data frame containing the observations for which propensity scores are requested. |
mapping |
A |
... |
Additional arguments passed to |
A numeric vector of propensity scores, 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)
ps <- PSPred(A ~ X1 + X2 + X4, pd_dat, pd_dat, map)
head(ps)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.