estimate_effects: Estimate natural (in)direct effects using an estimator of...

View source: R/B1-generic_dispatch.R

estimate_effectsR Documentation

Estimate natural (in)direct effects using an estimator of choice

Description

A wrapper function that calls on estimator-specific functions.

Usage

estimate_effects(
  data,
  s.wt.var = NULL,
  estimator = "Y2predR",
  cross.world = "10",
  effect.scale = "MD",
  boot.num = 999,
  boot.seed = NULL,
  boot.method = "cont-wt",
  boot.stratify = TRUE,
  ...
)

Arguments

data

A data frame.

s.wt.var

Optional, name of variable containing sampling weights.

estimator

The estimator of choice. See the paper. -> TOADD citation. Defaults to "Y2pred".

cross.world

The cross-world condition involved in the effect decomposition of choice. Should be "10" if want the (NDE0, NIE1) pair, "01" if want the (NIE0, NDE1) pair, or "both" if want both decompositions.

effect.scale

The scale of effect of choice. Defaults to "MD" (i.e., mean/risk difference or additive). If outcome is non-negative, also allows "mean ratio" (which could also be specified as "ratio", "MR", "risk ratio", "rate ratio", "RR"). If outcome is binary or bounded within the (0,1) interval, also allows "odds ratio" (which could also be specified as "OR").

boot.num

Number of bootstrap samples used for interval estimation, defaults to 999. If just want point estimate, set to 0.

boot.seed

Optional, specify bootstrap seed for reproducibility.

boot.method

Method for drawing bootstrap samples. Options: "cont-wt" for continuous weights bootstrap, and "resample" for bootstrap by simple resampling (i.e., integer weights bootstrap).

boot.stratify

Whether bootstrap samples are drawn stratified by treatment variable. Defaults to TRUE.

...

Inputs specific to the estimator.

Value

A list of objects, including


trangnguyen74/tnMediation documentation built on May 3, 2023, 6:58 a.m.