CalDIMsubgroup: Calculate diff-in-means estimates

View source: R/plot_itt.R

CalDIMsubgroupR Documentation

Calculate diff-in-means estimates

Description

Calculate average causal effect based on diff-in-means estimator.

Usage

CalDIMsubgroup(
  data,
  subgroup,
  name.group = c("Overall", "Female", "Male", "Non-white\nMale", "White\nMale")
)

Arguments

data

A data.frame of which columns includes a binary treatment (Z), an ordinal decision (D), and an outcome variable (Y).

subgroup

A list of numeric vectors for the index of each of the five subgroups.

name.group

A character vector including the labels of five subgroups.

Value

A data.frame of diff-in-means estimates for each value of D and Y for each subgroup.

Examples

data(synth)
subgroup_synth <- list(
  1:nrow(synth), which(synth$Sex == 0), which(synth$Sex == 1),
  which(synth$Sex == 1 & synth$White == 0), which(synth$Sex == 1 & synth$White == 1)
)
CalDIMsubgroup(synth, subgroup = subgroup_synth)


aihuman documentation built on April 12, 2025, 1:47 a.m.