Skip to contents

A function to calculate the effect of an intervention given the parameter estimates and intervention levels

Usage

calculate_effect(
  intervention_levels,
  variables,
  param_estimates,
  treatment_effect_type
)

Arguments

intervention_levels

A numeric vector indicating the levels of intervention for each predictor variable.

variables

A list of the names of the response variable and predictor variables extracted from the model.

param_estimates

A vector of parameter estimates from the model.

treatment_effect_type

Character string specifying the type of treatment effect to estimate. Options are "sq" for sequential treatment effects, which estimates effects for specific treatment sequences across visits, and "cum" for cumulative treatment effects, which assumes a single cumulative treatment variable representing the total exposure. The default is "sq".

Value

A numeric value representing the calculated effect of the specified intervention.