ggeffects
ggeffects copied to clipboard
ggeffect error when model has periodic splines
When I attempt to get estimated marginal means (using function ggeffect) from a model containing periodic splines, I get the error
Error in `[.data.frame`(md, , needed.vars, drop = FALSE) :
undefined columns selected
However, the exact same model formulation, but with natural splines used instead of periodic splines works perfectly.
Periodic splines model:
glmmTMB(movement_distance ~ mSpline(hour, df = 4) +
max_temp24 + mSpline(hour, df = 4)*max_temp24 +
ou(hour_fc-1|date_fc) + (1|ID),
data=data)
Natural splines model:
glmmTMB(movement_distance ~ ns(hour, df = 4) +
max_temp24 + ns(hour, df = 4)*max_temp24 +
ou(hour_fc-1|date_fc) + (1|ID),
data=model_df_new3)
Is this a bug that you could fix, or do you know why this is happening and how I can fix myself?
Thanks in advance.
Do you have a small reproducible example?
bump