Hi All,
I am trying to do
piecewise multilevel modelling for a continuous outcome (say pain score) and trying to find association with BMI over time (baseline, 12, and 24 months) by adjusting other confounders. I have the following questions;
1. How to do it with spline variables? I tried using Patrick Royston's example (please see in the link below) but unable to run his whole command as described here in the pdf below;
https://www3.nd.edu/~rwilliam/stats3/Margins03.pdf
2. Should I consider time as categorical or continuous?
3. How to get model estimated values for required BMI categories (i.e., normal/ overweight/ obese). I know margins command is used to get that but command does not work with cubic splines, and
Patrick Royston suggested to use 'mcp' command but I don't know how.

I'd appreciate for any help in my analysis

Regards,
Ram