In example below if I make a mistake and provide more levels than I would have in model e.g. labels=["m", "f", ""] the output for countrycit variable will be replaced with "" label for birth_sex:
m1TL = let levels = ["m", "f", ""]
form = @formula(
trial_latency ~
1 + age + cor +
birth_sex + countrycit+
(1 | subj))
contrasts = Dict(
:birth_sex => HypothesisCoding(
[
1/2 0 -1/2
0 1/2 -1/2
];
levels,
labels=["m", "f"],), # issue arise if - labels=["m", "f", " " ],),
:countrycit => SeqDiffCoding(),
:age => Center(29), #centered to median
)
fit(MixedModel, form, iat; contrasts)
end