Computes Controlled Direct Effect as the ratio of average hazard
contributions on the natural scale:
CDE(S) = mean(exp(theta_1[S])) / mean(exp(theta_0[S])).
compute_cde(df, subset_indicator = NULL)Numeric CDE value, or NA_real_ if columns are missing.
Data frame with theta_0 and theta_1 columns.
Optional logical/integer vector for subsetting.
If provided, only rows where subset_indicator == 1 are used.