Re: [R] natural cubic splines

2011-05-04 Thread David Winsemius
On May 4, 2011, at 8:34 AM, Joshua Wiley wrote: Hi Ondrej, What documentation have you looked at? Does this help at all? require(splines) ?ns ## one example summary(lm(y ~ ns(x, df = 3), data = data.frame(y = runif(100), x = rbinom(100, 9, .25)^2))) ## built in examples example(ns) Also,

Re: [R] natural cubic splines

2011-05-04 Thread Joshua Wiley
Hi Ondrej, What documentation have you looked at? Does this help at all? require(splines) ?ns ## one example summary(lm(y ~ ns(x, df = 3), data = data.frame(y = runif(100), x = rbinom(100, 9, .25)^2))) ## built in examples example(ns) Also, I am very fond of the book, Modern Applied Statisti

[R] natural cubic splines

2011-05-04 Thread Ondřej Mikula
Dear R-helpers, I need to fit natural cubic spline with specified number of knots. I expected 'splines' package will be helpful, but I am confused by its help. Is more detailed documentation available for it or could you recommend another R function? Best regards Ondrej Mikula

[R] Natural cubic splines produced by smooth.Pspline and predict function in the package "pspline"

2010-04-19 Thread Szymon Marszalek
Hello, I am using R and the smooth.Pspline function in the pspline package to smooth some data by using natural cubic splines. After fitting a sufficiently smooth spline using the following call: (ps=smooth.Pspline(x,y,norder=2,spar=0.8,method=1) [the values of x are age in years from 1 to 100]