Message-ID: <49D2890F.9000704@vanderbilt.edu>
Date: 2009-03-31T21:20:15Z
From: Frank E Harrell Jr
Subject: How to generate natural cubic spline in R?
In-Reply-To: <14764221-6D53-44B3-82AB-2FC4065DD755@comcast.net>
David Winsemius wrote:
> The splinefun documentation indicates that "natural" is one of the types
> of cubic spline options available.
>
> Does rcs actually do fitting? Such would not be my expectation on
> reading the documentation and I do not see any examples of such
> functionality in the help pages.
It expands a predictor into the truncated power basis functions for the
natural cubic spline. This is an easier basis to use than the B-spline
basis. rcs calls the Hmisc function rcspline.eval which you may want to
look at first.
Frank
--
Frank E Harrell Jr Professor and Chair School of Medicine
Department of Biostatistics Vanderbilt University