Hello everyone,
I tried several things but am too confused and need expert advice.
We are studying motor learning in which task there is a segment of trajectory that is repeated over all trials.
Thus, we have two variables:
- segment (repeated or not 5 levels)
- repetition (36 trials)
- segment-length as covariate (we want this effect to be withdrawn)
I am using brms in R which models through stan.
f2RMSE <- bf(RMSE ~ segment*repetition + (1 + segment*repetition | subjects))
m2RMSE <- brm(f2RMSE , data = data2, prior = pr, sample_prior = TRUE, save_pars = save_pars(all=TRUE), iter=5000)
Because we know that the repetition effect on performance (RMSE) will take some repetition to take effect, and might not change towards the end, we would like to use smooth model on repetition to have a sigmoid like feature.
But I struggle to fully understand how to use the s() function.
Should my model be like this :
RMSE ~ segment * s(repetition) + segmentLength + (1 + segment * s(repetition) + segmentLength | subjects)
or like this ?
RMSE ~ segmentLength + segment*repetition + s(subjects, bs = âreâ) + s(subjects, repetition, bs=âreâ) + (0 + segment + segmentLength | subjects)
Thanks for any help