help for rcs 

generate restricted cubic spline basis functions

rcs varname [if] [in , knots(numlist) [gen](stubname) [dgen](stubname)


rcs generates basis functions for restricted cubic splines and (optionally) their derivatives. The function is assumed linear beyond the two boundary knots.


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.


. rcs x, knots(10 30 50 70 90) gen(rcs)


Chris Nelson (cn46@le.ac.uk) and Paul Lambert (paul.lambert@le.ac.uk)

Also see