est_ps_bic  R Documentation 
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 lassobic
approach,
(ii) estimating a score using a classical logistic regression
with the afore selected covariates.
Internal function, not supposed to be used directly.
est_ps_bic(idx_expo, x, penalty = rep(1, nvars  1), ...)
idx_expo 
Index of the column in 
x 
Input matrix, of dimension nobs x nvars. Each row is an observation
vector. Can be in sparse matrix format (inherit from class

penalty 
TEST OPTION penalty weights in the variable selection to include in the PS. 
... 
Other arguments that can be passed to 
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.
An object with S3 class "ps", "bic"
.
expo_name 
Character, name of the drug exposure for which the PS was
estimated. Correspond to 
.
indicator_expo 
Onecolumn Matrix object.
Indicator of the drug exposure for which the PS was estimated.
Defined by 
.
score_variables 
Character vector, names of covariates(s) selected with the lassobic approach to include in the PS estimation model. Could be empty. 
score 
Onecolumn Matrix object, the estimated score. 
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)
psb2 < est_ps_bic(idx_expo = 2, x = drugs)
psb2$score_variables #selected variables to include in the PS model of drug_2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.