Open holyguy737 opened 10 months ago
Its true. It was a software engineering technical reason and primarily because it required a lot more coding effort to implement intrrvals for these differences. Currently the linear drlearner fits separate ols models for each treatment (compared to baseline). So then you have CIs for each treatment compared to baseline.
but to get CIs for diffs between T2 and T1 you need to also calculate the covariance between the parameters that were estimated in the ols for T2 and the parameters that were estimated in the ols for T1. But these parameters live in different ols models and these ols models only calculate covariances for their own parameters.
To calculate the covariance between parameters that live in separate ols models, the structure of the code needs to change a lot.
There was also an alternative design that we had considered which however would require blowing up the dataset to be K times larger than the original dataset (where K is the number of treatments) and containing many zeros. This could have allowed you to estimate all parameters simultaneously in a single OLS for all treatments. To avoid this blow up in memory we didnt go with that design, as we thought there wouldn’t be that many uses.
if you really want intervals for T2-T1, then consider simply changing the baseline treatment to be T1 (e.g. by making T1 the lexicographically smallest treatment) when you fit the DRLearner and refit your model.
Then since T1 will be your baseline you will be able to get intervals for that difference.
I have 10 treatment levels 0,1,2,...,9. I wanted the confidence interval for treatment effects given a X value using the effect_interval function. I ran the code effect_interval(X=X[:1],T0=1,T1=2). The above function is working fine for DML algorithms but while using DR algorithms it is throwing the following error: AttributeError: Can only calculate inference of effects between a non-baseline treatment and the baseline treatment! In the documentation effect_interval is meant to work for different base treatment levels as the user wants. Another point is that, the above issue is not occurring while using the effect function. So, how can I get this issue solved?