force_positivity: Enforce the Assumption of Positivity

Description Usage Arguments Value

View source: R/force_positivity.R

Description

Discretize continuous variables in the adjustment set (W) of a TMLE procedure in order to avoid practical violations of the assumption of positivity. Discretizes the numeric columns of an input matrix such that the newly created levels of each variable individually contain at least a specified mass when considering each level against levels of the treatment variable. INTERNAL USE ONLY.

Usage

1
force_positivity(A, W, pos_min = 0.1, q_init = 10)

Arguments

A

Numeric giving the levels of the (discretized) treatment variable.

W

Data.Frame or Matrix containing the covariates in the adjustment set to be discretized against the levels of the treatment variable.

pos_min

Numeric indicating the minimum mass (as a proportion) of the observations to be included in any cell of the table composed of the levels of the treatment against levels of an adjustment covariate.

q_init

Numeric indicating the initial number of levels to discretize a given adjustment variable into. This defaults to quantiles.

Value

A numeric vector with the adjustment variables re-coded into discrete levels respecting the minimum mass requested in each table comparing levels of the treatment against levels of an adjustment covariate.


methyvim documentation built on Nov. 8, 2020, 11:11 p.m.