generate restricted cubic spline basis functions
rcs varname [if] [in , knots(numlist) [gen](stubname) [dgen](stubname)
Description
rcs generates basis functions for restricted cubic splines and (optionally) their derivatives. The function is assumed linear beyond the two boundary knots.
Options
kknots(knots) list the knots.
gen(stubname) gives a stubname for the generated cubic splines variables. E.g. gen(rcs) will create variable rcs1, rcs2, ...
dgen(stubname) gives a stubname for the derivatives of the cubic spline variables. If this option is omitted, the derivatives are not calculated.
Example:
. rcs x, knots(10 30 50 70 90) gen(rcs)
Authors
Chris Nelson (cn46@le.ac.uk) and Paul Lambert (paul.lambert@le.ac.uk)
Also see