Skip to content

feat(cate): additional unit tests for multiple treatment levels#156

Draft
benesom wants to merge 2 commits intodevfrom
feat/additional-tests-cate-benesom
Draft

feat(cate): additional unit tests for multiple treatment levels#156
benesom wants to merge 2 commits intodevfrom
feat/additional-tests-cate-benesom

Conversation

@benesom
Copy link
Collaborator

@benesom benesom commented Mar 19, 2026

No description provided.

@benesom benesom requested a review from kkholst March 19, 2026 09:47
d_int$a <- as.integer(d$a) - 1
est_int <- cate(y ~ a * x, a ~ 1, data = d_int)

expect_equivalent(est_int$estimate$coefmat, est_factor$estimate$coefmat)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kkholst, we should discuss how we want to handle this case where a user provides a treatment variable with more than 2 levels that are encoded as integers. The behavior of cate is currently inconsistent. We get the same estimates for 2 treatment levels that are either encoded as a factor or integer, but estimates differ for 3 treatment levels (see failing test)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spotted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants