[R] interpretation of RCS 'coefs' and 'knots'

Dylan Beaudette debeaudette at ucdavis.edu
Sat Oct 24 01:23:12 CEST 2009


On Friday 23 October 2009, Frank E Harrell Jr wrote:
> Dylan Beaudette wrote:
> > Hi,
> >
> > I have fit a series of ols() models, by group, in this manner:
> >
> > l <- ols(y ~ rcs(x, 4))
> >
> > ... where the series of 'x' values in each group is the same, however
> > knots are not always identical between groups. The result is a table of
> > 'coefs' derived from the ols objects, by group:
> >
> > group	Intercept       top     top'    top''
> > 1      	 6.864   0.01    2.241   -2.65
> > 2      	 6.836   0.047   -0.556  0.606
> > 3      	 5.877   -0.019  0.084   -0.175
> > 4       	6.021   -0.003  0.121   -0.128
> > 5       	7.164   0.014   0.031   -0.096
> >
> > I would like to describe groups of relationships, based on the
> > coefficients, however I am not sure if they are directly comparable. In
> > addition, I would like to regress these coefs on another set of
> > variables, with the aim of predicting a series of RCS coefficients along
> > external gradients. In essence, I am hoping to use RCS coefficients to
> > summarize y ~ rcs(x), in a way that can then me modeled like this: [y ~
> > rcs(x)] ~ z.
> >
> > Is this interpretation of RCS coefficients even possible? If not, would
> > forcing knot locations make it a possibility? Or, would modeling both
> > knots and RCS coefs with external variables lead to sensible predictions?
> >
> > Cheers,
> > Dylan
>
> Dylan,
>
> It is possible to interpret rcs coefficients.  But it is not possible to
> equate coefficients across fits using different know locations.  My
> suggestion is either to specify the same knots (e.g., rcs(x, c(2, 4, 6,
> 8)) across fits or to compare the fitted relationships (predictions)
> rather than the coefficients.
>
> Frank

Thanks Frank. That makes sense. Unfortunately the knot locations dot not 
always occur in the same places. 

Perhaps I am approaching the problem from the wrong angle. This project 
involves patterns that are well characterized by rcs(x). The shape of the 
fitted rcs function seems to relate well to some other set of variables Z. 
Ideally, I would like to be able to predict the minimal required parameters 
needed to regenerate the continuous function rcs(x), based on matrix Z. This 
all boils down to soil properties varying in space and depth, with strong 
depth-trends that are interesting. Therefore, I am looking for an approach 
that can be used to model the 'shape' of y ~ rcs(x).

Aside from all of this, is there some way to synthesize rcs(x) from the 
returned coefs, and the knot locations?

Cheers,
Dylan


-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341




More information about the R-help mailing list