I am trying to implement a special case of generalized additive mixed model using R mgcv package without success and in need of advice.
Specifically, the model has mixed effect of levels which scales common smooth link function (please see the attached figure). In other words, the model has random smooth with common trajectory (curvature) but differently scaled.
I have already tried
gam(y ~ te(level,x,bs=c('re','tp'),k=3))
where level denotes a factor variable denoting levels with mixed effects, and x denotes a continuous variable. But this results in smooth link function with different trajectory.
Thank you in advance.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…