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

View source: R/est_ps_bic.R

est_ps_bicR Documentation

propensity score estimation in high dimension with automated covariates selection using lasso-bic

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 lasso-bic approach, (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_bic(idx_expo, x, penalty = rep(1, nvars - 1), ...)

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).

penalty

TEST OPTION penalty weights in the variable selection to include in the PS.

...

Other arguments that can be passed to glmnet from package glmnet other than penalty.factor, family, maxp and path.

Details

betaPos option of lasso_bic function is set to FALSE and maxp is set to 20. For optimal storage, the returned elements indicator_expo and score are Matrix with ncol = 1.

Value

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

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 lasso-bic approach 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

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)
psb2 <- est_ps_bic(idx_expo = 2, x = drugs)
psb2$score_variables #selected variables to include in the PS model of drug_2


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