Skip to content

Commit

Permalink
allow for regressions without fe
Browse files Browse the repository at this point in the history
  • Loading branch information
s3alfisc committed Mar 5, 2023
1 parent 0cec0fd commit d6c3ca6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions pyfixest/FormulaParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@ def __init__(self, fml):
For covars and fevars, where multiple estimation is supported,
move the sublist to the beginning of the respective list
'''


# tba
# check if there is a variable '0'
# in the formula and throw error if the case
# '0' used internally to denote absence of fixed
# effects

fml = "".join(fml.split())
fml_split = fml.split('|')
depvars, covars = fml_split[0].split("~")
fevars = fml_split[1]


if len(fml_split) > 1:
fevars = fml_split[1]
else:
fevars = "0"

self.depvars = depvars.split("+")
self.covars = _unpack_fml(covars)
self.fevars = _unpack_fml(fevars)
Expand Down

0 comments on commit d6c3ca6

Please # to comment.