Hi,

I'm working with a dataset with high attrition rate and am considering using Lee bounds to estimate the treatment effect. Below is the code I am using to determine the share of respondents I need to trim above/below to compute the Lee bounded treatment effect for a binary treatment variable.
Code:
quietly count if intervention==0 & time==0
local tot_control=`r(N)'
quietly count if intervention==1 & time==0
local tot_treatment=`r(N)'
quietly count if intervention==0 & time==1 & consent2==1
local found_control=`r(N)'
quietly count if intervention==1 & time==1 & consent2==1
local found_treatment=`r(N)'
local q_control=`found_control'/`tot_control'
local q_treatment=`found_treatment'/`tot_treatment'
  
if `q_treatment'>`q_control' {
local q1=(`q_treatment'-`q_control')/`q_treatment'
}
if `q_treatment'<`q_control' {
    local q1=(`q_control'-`q_treatment')/`q_control'
}
I was wondering how I would proceed if I have three treatment groups (Treatment 1, Treatment 2 and Control).

Thanks