shah-in-boots / rmdl

A Causality-Informed Modeling Appraoch
https://shah-in-boots.github.io/rmdl/
Other
0 stars 0 forks source link

Formula expansion using interaction terms fails to include both raw interaction term and it crossed against exposure #35

Closed shah-in-boots closed 8 months ago

shah-in-boots commented 8 months ago

As we can see below, there should be an formula level that looks like... hp ~ wt + am + wt:am instead, however, it splits the interaction terms.

library(vlndr)
#> Loading required package: vctrs
#> Loading required package: tibble
#> 
#> Attaching package: 'tibble'
#> The following object is masked from 'package:vctrs':
#> 
#>     data_frame
fmls(hp ~ .x(wt) + .i(am), pattern = "parallel")
#> Interaction term `am` was applied to exposure term `wt`
#> hp ~ wt + am
#> hp ~ wt + wt:am

Created on 2024-01-25 with reprex v2.1.0

As exploring this issue, here are trouble spots that have been found:

shah-in-boots commented 8 months ago

Fixed in most recent commit