Skip to content

pre_process_did data type error #74

@OkFranco

Description

@OkFranco

Hello,

I was trying to leverage ATTgt().fit() and was consistenly getting a the following message. Res_num was supposed to be a covariate to be used in the xformla

Warning: Formula processing failed: Error evaluating factor: NameError: name 'res_num' is not defined
    ~1 + res_nu

After debugging the code I found the error. In pre_process_did, it was unable to go through either of the following:

try:
      _, x_cov = fml(xformla, data=data, return_type='dataframe')
    except Exception:
      x_cov = patsy.dmatrix(xformla, data=data, return_type='dataframe')

The problem was that column in the data provided to ATTgt was not int64 or float64, but was in object type.

Potentially inserting a error message more directed to a data type error could be useful for future users.

Thank you for the great work!! This has been super helpful
best
João Franco

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions