ps_pond_one {adapt4pv} | R Documentation |
Implement the weighting on propensity score with Matching Weights (MW) or the Inverse Probability of Treatment Weighting (IPTW) for one drug exposure. The binary outcome is regressed on the drug exposure of interest through a classical weighted regression. Internal function, not supposed to be used directly.
ps_pond_one( ps_est, y, weights_type = c("mw", "iptw"), truncation = FALSE, q = 0.025 )
ps_est |
An object of class |
y |
Binary response variable, numeric. |
weights_type |
Character. Indicates which type of weighting is implemented. Could be either "mw" or "iptw". |
truncation |
Bouleen, should we do weight truncation?
Default is |
q |
If |
The MW are defined by
mw_i = min(PS_i, 1-PS_i)/[(expo_i) * PS_i + (1-expo_i) * (1-PS_i) ]
and weights from IPTW by
iptw_i = expo_i/PS_i + (1-expo_i)/(1-PS_i)
where expo_i is the drug exposure indicator.
The PS could be estimated in different ways: using lasso-bic approach,
the hdPS algorithm or gradient tree boosting using functions
est_ps_bic
, est_ps_hdps
and est_ps_xgb
respectivelly.
An object with S3 class "ps","*"
,
where "*"
is "mw"
or "iptw"
, same as the
input parameter weights_type
expo_name |
Character, name of the drug exposure for which the PS was estimated. |
estimate |
Regression coefficient associated with the drug exposure in adjustment on PS. |
pval_1sided |
One sided p-value associated with the drug exposure in adjustment on PS. |
pval_2sided |
Two sided p-value associated with the drug exposure in adjustment on PS. |
Could return NA if the adjustment on the PS did not converge.
Emeline Courtois
Maintainer: Emeline Courtois
emeline.courtois@inserm.fr
set.seed(15) drugs <- matrix(rbinom(100*20, 1, 0.2), nrow = 100, ncol = 20) colnames(drugs) <- paste0("drugs",1:ncol(drugs)) ae <- rbinom(100, 1, 0.3) pshdps2 <- est_ps_hdps(idx_expo = 2, x = drugs, y = ae, keep_total = 10) pondps2 <- ps_pond_one(ps_est = pshdps2, y = ae, weights_type = "iptw") pondps2$estimate #estimated strength of association between drug_2 and the outcome by PS weighting