getTes | R Documentation |
This function extracts the true treatment effects from a full coefficient vector
as generated by genCoefs()
. It calculates the overall average treatment effect on the
treated (ATT) as the equal-weighted average of the cohort-specific treatment effects, and also
returns the individual treatment effects for each treated cohort.
getTes(coefs_obj)
coefs_obj |
An object of class |
The function internally uses auxiliary routines getNumTreats()
, getP()
,
getFirstInds()
, getTreatInds()
, and getActualCohortTes()
to determine the
correct indices of treatment effect coefficients in beta
. The overall treatment effect
is computed as the simple average of these cohort-specific effects.
A named list with two elements:
A numeric value representing the overall average treatment effect on the treated. It is computed as the (equal-weighted) mean of the cohort-specific treatment effects.
A numeric vector containing the true cohort-specific treatment effects, calculated by averaging the coefficients corresponding to the treatment dummies for each cohort.
## Not run:
# Generate coefficients
coefs <- genCoefs(R = 5, T = 30, d = 12, density = 0.1, eff_size = 2, seed = 123)
# Compute the true treatment effects:
te_results <- getTes(coefs)
# Overall average treatment effect on the treated:
print(te_results$att_true)
# Cohort-specific treatment effects:
print(te_results$actual_cohort_tes)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.