[R-lang] Re: Model comparison with restricted cubic splines

Morgan Sonderegger morgan@cs.uchicago.edu
Thu Feb 3 11:50:40 PST 2011


Hi Ariel,

rcs(X,3) consists of two "orthogonal basis functions" of X: the first is X
itself, and the second is a nonlinear function of X.  (The details of rcs
are given in Harrell 2001, but I haven't been able to find them online.)

Hence, rcs(X,3) is a superset of X, and you can use anova to perform a
likelihood ratio test, to see if the inclusion of the non-linear term is
warranted.  For example:

mod1 <- lm( y ~ x)
mod2 <- lm(y ~ rcs(x,3))

anova(mod1,mod2)

If the resulting p-value falls below your threshold for significance (0.05,
0.01..), you can conclude that the extra term is justified.

Morgan





On Thu, Feb 3, 2011 at 11:16 AM, Ariel M. Goldberg <ariel.goldberg@tufts.edu
> wrote:

> Hello,
>
> I have a really really basic question that I can't seem to figure out.  I'm
> interested in determining whether a non-linear predictor (using restricted
> cubic splines) is warranted in my model.  For a predictor X, how do I
> determine using lmer whether rcs(X,3) is significantly better than just X?
>
> Thank you,
> Ariel
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucsd.edu/pipermail/ling-r-lang-l/attachments/20110203/e76da680/attachment.html 


More information about the ling-r-lang-L mailing list