Skip to content

Nonlinear operations on treatment #193

Open
@jmafoster1

Description

@jmafoster1

Is your feature request related to a problem? Please describe.
Having implemented the ability to pass in custom regression equations, I'm now at a point where I'd like to look at "nonlinear" operators such as powers, logs, etc. This works great for things which aren't the treatment variable, but it doesn't like it when you try to do things with the treatment variable (e.g. give it a log relationship) because the exact treatment variable name "X" isn't in the model to look up. "log(x)" is in the model, but there doesn't seem to be an easy way to relate the two such that you can tell it to go and look up "log(X)" instead.

There's a couple of solutions that could work here.

  1. Have a preprocessing function similar, to how we populate metavariables, that takes a dataframe and transforms it while keeping the column headings the same. This would be straightforward to implement but somehow feels inelegant and might be cumbersome to use.
  2. Have a backend which automatically creates the mapping between straight variable names and nonlinear operations over them. Or we could just pass in a function which defines this mapping. This would be easier to use, but would rely on only one term involving the treatment variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions