beacon-biosignals / Effects.jl

Effects Prediction for Regression Models
MIT License
19 stars 4 forks source link

Define behavior for missing levels in design/reference grid #3

Closed palday closed 3 years ago

palday commented 3 years ago

I'm a bit worried about computing the schema from the reference grid (rather than the original data/concrete terms in the original formula). If the reference grid omits levels for any of the categorical variables, I think you'll get a mismatch between the columns you generate and columns that are present in the original modelmatrix, unless you also specify the correct contrasts in the contrasts argument.

Like I said above, I think it's a safe assumption that you can get the formula that was used to fit the model, so you can just match the terms present in that with the (un-typed) terms in the provided formula (or even with the keys from the design dict)

_Originally posted by @kleinschmidt in https://github.com/beacon-biosignals/Effects.jl/pull/1#discussion_r573839176_

palday commented 3 years ago

Closed by #19