Estimated Marginal Means of Non-Linear Custom Models

Hi all,

I have a non-linear model specified similarly to Markus’ “real-world” example in:
https://cran.r-project.org/web/packages/brms/vignettes/brms_nonlinear.html

Using Markus’ example, is there a package or code recommendation that would allow for marginal effects to be expressed on “AY”? The emmeans package does not support such models, and whilst the “conditional_effects” function in brms shows the years separately, I am trying to estimate the differences between them over time.

Cheers,

Matt

I think it will be easiest to implement this yourself via fitted() or posterior_epred(). You can obtain estimates conditional on the group effects by specifying re.formula. If you want to obtain posterior estimates of functions of the parameters, then you can do this from the samples.

Hey Andrew,

Thanks for your thoughts regarding my issue. In lieu of any other input, I will implement this approach myself.

Cheers,

Matt