This repository contains an R functions designed to estimate the Average Treatment Effect on the Treated (ITT) and Local Average Treatment Effect (LATE) using various methods, including Difference in Means and Difference in Differences. The function allows for adjustment for clustering and provides options for methods such as Lee Bounds and Inverse Probability Weighting (IPW).
The function f_oppen_estima_ITT_LATE
takes the following parameters:
dados
: The dataset containing the variables of interest.vars_controle
: A list of control variables.vars_resultado
: A list of outcome variables.var_tratamento_sorteado
: The treatment assigned by randomization.var_tratamento_recebido
: The actual treatment received.tempo_final
: The final time point for impact analysis.vars_cluster
: The clustering variable(s).output_path
: The output path to save the results.
The function performs the following steps:
- Filters the dataset based on the specified variables and time points.
- Implements Lee Bounds method to handle non-random attrition if applicable.
- Estimates ITT and LATE using specified methods (e.g., Difference in Means, Difference in Differences).
- Computes standard errors using robust or clustered standard errors.
- Saves the results to an Excel file.
To use the function:
- Load the function into your R environment.
- Prepare your dataset with appropriate variables.
- Call the function with the required parameters.
f_oppen_estima_ITT_LATE(dados, vars_controle, vars_resultado,
var_tratamento_sorteado, var_tratamento_recebido,
tempo_final, vars_cluster, output_path)
Ensure that your dataset and variable names match the parameters provided to the function. Additionally, review the output for meaningful interpretation of treatment effects.