BUG: formula with whitespace isn't parsed despite `formulaic` being able to do the same
amichuda opened this issue · comments
Aleksandr Michuda commented
Hi,
I'm using linearmodels==4.26
PanelOLS
can't seem to parse a formula with whitespace, while formulaic
can:
from formulaic import model_matrix
import pandas as pd
from linearmodels import PanelOLS
d = pd.DataFrame({'var a' : [1,2.3]})
model_matrix("`var a` ~ 1", data=d)
PanelOLS.from_formula('`var a` ~ 1', data=d)
where I get this error from linearmodels:
FormulaSyntaxError: Missing operator between `var` and `a`.
0 + ⧛var a⧚
while formulaic outputs the model.
I think this might a bug?
Kevin Sheppard commented
This is almost certanily my fault as I handle EntityEffect myself, and probably in a way that is not compatible with formulaic. Thanks for the report.