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)
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_