View source: R/ps_adjust_one.R
ps_adjust_one | R Documentation |
Implement the adjustment on propensity score for one drug exposure. The binary outcome is regressed on the drug exposure of interest and its estimated PS. Internal function, not supposed to be used directly.
ps_adjust_one(ps_est, y)
ps_est |
An object of class |
y |
Binary response variable, numeric. |
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","adjust"
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)
adjps2 <- ps_adjust_one(ps_est = pshdps2, y = ae)
adjps2$estimate #estimated strength of association between drug_2 and the outcome by PS adjustment
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.