Repository navigation
Conversation
DoubleMLVector._get_data_for_model always appended the other treatment columns to the covariates of each single-treatment sub-model, ignoring DoubleMLData(use_other_treat_as_covariate=False). PLRVector therefore fitted a different model than the legacy DoubleMLPLR on the same data. Append the other treatments only if use_other_treat_as_covariate is True, as DoubleMLData.set_x_d does. Run the PLRVector vs DoubleMLPLR comparison tests for both values of the flag and check the covariates of each sub-model.
JanTeichertKluge
self-requested a review
November 2, 2026 20:47
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
DoubleMLVector._get_data_for_modelalways appended the other treatment columns to the covariates of each single-treatment sub-model, ignoringDoubleMLData(use_other_treat_as_covariate=False).PLRVectortherefore fitted a different model than requested, and a different one from the legacyDoubleMLPLRon the same data.doubleml/double_ml_vector.py: append the other treatments only ifuse_other_treat_as_covariateisTrue, asDoubleMLData.set_x_ddoes.True) is unchanged.DoubleMLScalarsingle-treatment check passes") didn't hold: the sub-models pass all checks without the extra columns.doubleml/plm/tests/test_plr_vector_vs_plr.py:DoubleMLPLR(coefficients, standard errors, per-repetition values, sensitivity elements) now runs for both values ofuse_other_treat_as_covariate.test_submodel_covariateschecks each sub-model's covariates.Falsecases (64 of 128) fail before the fix.Reference to Issues or PRs
Fixes #442
Comments
This only affects the unreleased vector API from #394.
#441 (the fix for #440) also changes
double_ml_vector.pyandtest_plr_vector_vs_plr.py, in different places. The two PRs merge cleanly in either order. With both applied, the benchmark test added in #441 also runs, and passes, foruse_other_treat_as_covariate=False.PR Checklist