set_treatment: Specifiy a treatment variable for a controlled direct effect

View source: R/treat.R

set_treatmentR Documentation

Specifiy a treatment variable for a controlled direct effect

Description

This function specifies a treatment variable in the sequence of treatment variables that define the controlled direct effect of interest.

Usage

set_treatment(
  object,
  treat,
  formula = NULL,
  treat_type = "categorical",
  eval_vals = NULL
)

Arguments

object

A cde_estimator object that may or may have previous treatment variables specified/

treat

Name of the treatment variable (not quoted).

formula

One-sided formula giving the covariates that are pre-treatment to this treatment, but post-treatment to any previous treatment. Unless overridden by the arguments to treat_model() or outreg_model(), this formula will be the specification used in the modeling of the propensity scores or outcome regressions.

treat_type

A string indicating the type of variable this is. Takes either the values "categorical" or "regression" (the latter is not yet implemented). of

eval_vals

A numeric vector of values of this variable to evaluate the controlled direct effecct. If NULL (the default), this will be set to all observed values of the variable.

Value

An updated cde_estimator with this information about the treatment specified.

Author(s)

Matthew Blackwell


mattblackwell/DirectEffects documentation built on Dec. 16, 2024, 6:14 p.m.