Plot fitted curve from smooth splines

My data is fitted using brms with the following model,

fm <- brm(value ~ s(time, k=-1, bs = "cs") + (1|subj), data=dat)

When I plot out the following

plot(marginal_smooths(fm))

it shows the curve centered around (x_0, 0), where x_0 seems to be the mean of the ‘time’ value of the input data. How can I properly shift the plotting so that it recovers the original data range of ‘value’? Using the estimated intercept somehow?

marginal_effects?

2 Likes

Perfect! Thanks a lot!