Estimate propensity scores using logistic regression or random forest model.
psrwe_est(
data,
ps_fml = NULL,
ps_method = c("logistic", "randomforest"),
v_covs = "V1",
v_grp = "Group",
cur_grp_level = 1,
v_arm = NULL,
ctl_arm_level = NULL,
stra_ctl_only = TRUE,
nstrata = 5,
trim_ab = c("both", "above", "below", "none"),
.drop_arg_fml = FALSE,
...
)A list of class PSRWE_DAT with items:
Original data with column _ps_ for estimated PS scores
and _strata_ for PS stratum added.
PS formula for estimated PS scores.
Whether the current study is a randomized study.
Number of strata.
Data frame with group assignment and covariates.
Propensity score (PS) formula. If NULL, all covariates
will be included in the PS model in a linear form.
Method to calculate propensity scores. Can be set to
logistic for logistic regression or randomforest for a
random forest approach.
Column names corresponding to covariates.
Column name corresponding to group assignment.
Group level for the current study. Default is
cur_grp_level = 1. Ignored for single-arm studies.
Column name corresponding to arm assignment.
Arm level for the control arm. Ignored for single-arm studies.
Create strata by control arm patients only. Default
TRUE. Ignored by single-arm studies. For randomized studies, when
stra_ctl_only is FALSE, strata are created based on the PS
scores of the entire current study patients.
Number of PS strata to be created.
Trim external subjects who are above or below the
range of current study. Default both trims both above and below.
Other options include above for above only, below for
below only, and none for no trimming.
internal use to drop arguments and call, this is only used in cjk.
Additional parameters for calculating the propensity score to be
used in randomForest or glm .
data(ex_dta)
psrwe_est(ex_dta,
v_covs = paste("V", 1:7, sep = ""),
v_grp = "Group",
cur_grp_level = "current")
Run the code above in your browser using DataLab