[R] Splines under tension

David Winsemius dwinsemius at comcast.net
Sun May 16 22:20:47 CEST 2010


On May 16, 2010, at 1:12 PM, sam.e wrote:

>
> Thank you for the helpful direction to the smoothing splines  
> function, it was
> very helpful and is exactly what i am trying to do. My data however  
> is 3-D,
> i.e. i have x and y values which are coordinates for different field  
> sites
> and z values which are really what I am interested in analysing with
> interpolation. This has posed a problem with many of the spline  
> functions in
> R. Even if i input my coordinate data as a matrix as my 'x' value  
> and my
> site data as my 'y' values i get the following error:

You could look at the code in the Design or rms packages for handling  
crossed regression splines. I believe that the ols function within  
those packages will handle the identity link models, although my  
experience is only with the lrm and cph models. In those frameworks  
with logistic and log links I am able to estimate outcomes with two- 
dimensional splines. Harrell also provides a "%ia%" operator that  
provides for spline models with a reduced number of degrees of  
freedom. The best place to find a coherent description of the math is  
his book "Regression Modeling Strategies".

-- 
David


>
> Error in xy.coords(x, y) : 'x' and 'y' lengths differ
>
> I have made sure that there are the same amount of values and that  
> they are
> all of the same type, i.e. numeric but with little luck and i am a  
> bit lost
> as to what to try next. Does anyone have any suggestions?
>
> Thanks,
>
> Sam
> -- 
> View this message in context: http://r.789695.n4.nabble.com/Splines-under-tension-tp2173887p2218693.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list