Skip to content

Make predict easier? #134

@nilshg

Description

@nilshg

predict currently raises an error, advising the user to estimate the model with the save = :fe kwarg and the access the fixed effects using fe().

If I'm not mistaken, this advise only covers the retrieval of fixed effects, but doesn't actually give a prediction. I'm currently doing:

fem = reg(df, @formula(y ~ x1 + x2 + fe(x3) + fe(x4)), save = :fe)

[df.x1 df.x2] * coef(fem) .+ fe(fem).fe_x3 .+ fe(fem).fe_x4

which I believe produces the correct predictions from the model (do correct me if I'm getting something wrong here!)

Could this be turned into a predict method, which accepts the fem object directly provided it has been estimated with save = :fe?

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