Skip to content

NA handling for predict and predict with new data #1236

@leostimpfle

Description

@leostimpfle

Is this behaviour of pyfixest.estimation.models.feols_.Feols.predict intentional? It seems slightly odd that we drop NaNs and singletons in the newdata is None case but not in the newdata is not None case.

import numpy as np

import pyfixest as pf

data = pf.get_data(N=1_000, seed=0, model="Feols")
fit = pf.feols("Y ~ X1", data = data)

np.isnan(fit.predict(newdata=None)).any()  # False (NaNs and singletons are dropped)
np.isnan(fit.predict(newdata=data)).any()  # True (NaNs and singletons are kept)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions