est_ps_hdps: propensity score estimation in high dimension with automated...

View source: R/est_ps_hdps.R

est_ps_hdpsR Documentation

propensity score estimation in high dimension with automated covariates selection using hdPS

Description

Estimate a propensity score to a given drug exposure by (i) selecting among other drug covariates in x which ones to include in the PS estimation model automatically using hdPS algorithm, (ii) estimating a score using a classical logistic regression with the afore selected covariates. Internal function, not supposed to be used directly.

Usage

est_ps_hdps(idx_expo, x, y, keep_total = 20)

Arguments

idx_expo

Index of the column in x that corresponds to the drug covariate for which we aim at estimating the PS.

x

Input matrix, of dimension nobs x nvars. Each row is an observation vector. Can be in sparse matrix format (inherit from class "sparseMatrix" as in package Matrix).

y

Binary response variable, numeric.

keep_total

number of covariates to include in the PS estimation model according to the hdps algorithm ordering. Default is 20.

Details

Compared to the situation of the classic use of hdps (i) there is only one dimension (the co-exposition matrix) (ii) no need to expand covariates since they are already binary. In other words, in our situation hdps consists in the "prioritize covariates" step from the original algorithm, using Bross formula. We consider the correction on the interpretation on this formula made by Richard Wyss (drug epi).

Value

An object with S3 class "ps", "hdps".

expo_name

Character, name of the drug exposure for which the PS was estimated. Correspond to colnames(x)[idx_expo]

.

indicator_expo

One-column Matrix object. Indicator of the drug exposure for which the PS was estimated. Defined by x[, idx_expo].

.

score_variables

Character vector, names of covariates(s) selected with the hdPS algorithm to include in the PS estimation model. Could be empty.

score

One-column Matrix object, the estimated score.

Author(s)

Emeline Courtois
Maintainer: Emeline Courtois emeline.courtois@inserm.fr

References

Schneeweiss, S., Rassen, J. A., Glynn, R. J., Avorn, J., Mogun, H., Brookhart, M. A. (2009). "High-dimensional propensity score adjustment in studies of treatment effects using health care claims data". Epidemiology. 20, 512–522, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1097/EDE.0b013e3181a663cc")}

Examples


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)
pshdps2$score_variables #selected variables to include in the PS model of drug_2


adapt4pv documentation built on May 31, 2023, 6:08 p.m.