Skip to main content
3 events
when toggle format what by license comment
Aug 26 at 9:29 comment added Tek This code doesn't seem correct, or I might have misunderstood how linear splines work. Here’s what I have: {r } pa600 = pmin(600, pa) change600 = pmax(0, pa - 600) change2400 = pmax(0, pa - 2400) change4200 = pmax(0, pa - 4200) Assuming physical activity (pa) levels with knots at 600, 2400, and 4200, here’s how the code should work: • If pa is 437, seems good. • If pa is 2133, all good. But • If pa is 4100, I thought change600 should be 1800. • If pa is 4238, I expect change2400 & change4200 to be 1800 & 1800 respectively. Am I misunderstanding how linear splines work?
Aug 23 at 12:46 comment added Ben Bolker You can probably get everything you need (predictions, predicted slopes, etc.) from some combination of predict() and emmeans::emtrends(). Now that the question is not "why don't the coefficients make sense?" but "how do I derive [quantity X] and plot it?", this is turning back into a Stack Overflow question. If you can post a focused question there with a reproducible example, I'm sure someone will answer it.[
Aug 22 at 22:40 history answered Thomas Lumley CC BY-SA 4.0