cdgd1_pa: Perform conditional decomposition via parametric models

View source: R/cdgd1_pa.R

cdgd1_paR Documentation

Perform conditional decomposition via parametric models

Description

Perform conditional decomposition via parametric models

Usage

cdgd1_pa(
  Y,
  D,
  G,
  X,
  Q,
  data,
  alpha = 0.05,
  trim1 = 0,
  trim2 = 0,
  weight = NULL
)

Arguments

Y

Outcome. The name of a numeric variable (can be binary and take values of 0 and 1).

D

Treatment status. The name of a binary numeric variable taking values of 0 and 1.

G

Advantaged group membership. The name of a binary numeric variable taking values of 0 and 1.

X

Confounders. A vector of variable names.

Q

Conditional set. A vector of variable names.

data

A data frame.

alpha

1-alpha confidence interval.

trim1

Threshold for trimming the propensity score. When trim1=a, individuals with propensity scores lower than a or higher than 1-a will be dropped.

trim2

Threshold for trimming the G given Q predictions. When trim2=a, individuals with G given Q predictions lower than a or higher than 1-a will be dropped.

weight

Sampling weights. The name of a numeric variable. If unspecified, equal weights are used. Technically, the weight should be a deterministic function of X only (note that this is different from the unconditional decomposition).

Value

A dataframe of estimates.

Examples

data(exp_data)

results <- cdgd1_pa(
Y="outcome",
D="treatment",
G="group_a",
X="confounder",
Q="Q",
data=exp_data)

results

cdgd documentation built on June 16, 2025, 9:06 a.m.