Our research group would like to use restricted cubic splines in the twopm regression command (among other places).
We can figure out from the available doc and web resources how to specify and execute the models we are interested in.
But we aren't sure how to correctly specify the margins command afterward, unless it is correct to assume we can
just exactly copy the syntax from linear splines (which seems too easy to be correct).
We'd like to be directed to a URL with an example where the margins option is used with the covariate that is being
expressed as a restricted cubic spline. To be more concrete, we would like to compare treatment groups at different ages,
where age (a continuous independent variables) is being expressed as a restricted cubic spline.
That is, we'd like to construct the command for "margins, dydx(treatment) at(age=35)" when age might be
made/expressed from a command like "mkspline agesp = age, cubic knots(20 30 40 50 60)".
Can someone point us to a useful resource?
We can figure out from the available doc and web resources how to specify and execute the models we are interested in.
But we aren't sure how to correctly specify the margins command afterward, unless it is correct to assume we can
just exactly copy the syntax from linear splines (which seems too easy to be correct).
We'd like to be directed to a URL with an example where the margins option is used with the covariate that is being
expressed as a restricted cubic spline. To be more concrete, we would like to compare treatment groups at different ages,
where age (a continuous independent variables) is being expressed as a restricted cubic spline.
That is, we'd like to construct the command for "margins, dydx(treatment) at(age=35)" when age might be
made/expressed from a command like "mkspline agesp = age, cubic knots(20 30 40 50 60)".
Can someone point us to a useful resource?
Comment