SUMM/DOC/ENH interaction between continuous, categorical exog

Open
#5,387 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
18/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start by reading the design_info discussion and checking how patsy represents continuous, categorical, and interaction terms. Review wald_test_terms, GAM test_significance, and issue #5332 to map the existing post-estimation support. Done would require a defined parameterization and documented support boundaries for tests, margins, predictions, and plots.

Written by the indexing model from the issue text.

Description

comp-base design topic-post_estim type-enh

general issue: I have no idea how well this works, and AFAIK we don't have an example

How well does patsy handle this? What is the parameterization? Which collinear columns are dropped?

post-estimation support

so far we have nothing, AFAIK

  • wald tests, nothing specific,
    • wald_test_terms should work if names or terms have a identifiable structure
    • premade specific tests for interaction effects, e.g. diff across categorical levels
    • wald test restriction matrix for diff should be just two calls to np.eye or diag with the right indices
      (I'm doing something similar for zero tests in GAM test_significance)
  • margins, partial predict: nothing yet. We need information about underlying variables
  • graphics, plots: also nothing yet. We still don't have interaction plots that work for models neither for categorical nor for categorical-continuous interaction.

We might have enough information in the design_info to support this when formulas are used.

interaction exog columns created by statsmodels:

  • GAM in mgcv has a by option to split estimate and interaction between smooth component and categorical variable #5332
    I don't know (yet) how we should handle collinear columns in this case, e.g. main effect plus "left-over" interaction effect, or only full interaction effects. : versus * in formulas.
Dominant language
Python
Stars
11.6k
Forks
3.6k
Avg merge
7h 37m
Merged PRs (30d)
96

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from statsmodels/statsmodels

All issues in statsmodels/statsmodels

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.