Skip to content

Add weights for categorical exposures#34

Merged
malcolmbarrett merged 7 commits intomainfrom
categorical
Aug 1, 2025
Merged

Add weights for categorical exposures#34
malcolmbarrett merged 7 commits intomainfrom
categorical

Conversation

@malcolmbarrett
Copy link
Copy Markdown
Member

@malcolmbarrett malcolmbarrett commented Aug 1, 2025

Closes #12

@malcolmbarrett malcolmbarrett requested a review from Copilot August 1, 2025 16:49

This comment was marked as outdated.

@malcolmbarrett malcolmbarrett requested a review from Copilot August 1, 2025 17:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive support for categorical exposures to propensity score weighting functions. The implementation enables weight calculation for multi-category treatments using matrix-based propensity scores and tilting functions specific to each estimand type.

Key changes include:

  • Addition of categorical exposure support for all weight functions (ATE, ATT, ATU, ATM, ATO, Entropy)
  • Implementation of propensity score matrix validation and column name handling
  • Updates to error handling with new categorical-specific error classes

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/testthat/test-weights.R Updates error classes from unsupported to matrix type errors for categorical exposures
tests/testthat/test-weights-categorical.R Comprehensive test suite for categorical exposure weight calculations
tests/testthat/test-weights-categorical-comparison.R Integration tests comparing results with WeightIt and PSweight packages
man/wt_ate.Rd Documentation updates for categorical exposure support and focal parameter
R/weights.R Core implementation of categorical weight calculations and estimand-specific logic
R/weights-utils.R Utility functions for categorical exposure validation and matrix handling
DESCRIPTION Addition of nnet package as suggested dependency

malcolmbarrett and others added 2 commits August 1, 2025 19:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@malcolmbarrett malcolmbarrett merged commit 10035c1 into main Aug 1, 2025
6 checks passed
@malcolmbarrett malcolmbarrett deleted the categorical branch February 24, 2026 01:37
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.

support categorical exposures

2 participants