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

Ariel M. Goldberg ariel.goldberg@tufts.edu
Thu Feb 3 14:34:58 PST 2011


Dear Morgan,

Thank you so much!  I was hoping that rcs() would be structured in this fashion.

Best,
Ariel

On Feb 3, 2011, at 2:50 PM, Morgan Sonderegger wrote:

> 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
> 
> 
> 
> 

--
Ariel M. Goldberg
Assistant Professor
Tufts University
Department of Psychology
490 Boston Avenue
Medford, MA 02155

(617) 627-3525
http://ase.tufts.edu/psychology/psycholinglab/




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