Re: [R] natural cubic splines

From: Joshua Wiley <jwiley.psych_at_gmail.com>
Date: Wed, 04 May 2011 08:34:03 -0700

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 Statistics with S by Venables & Ripley. It has a section on splines that might help you.

Cheers,

Josh

2011/5/4 Ondřej Mikula <onmikula_at_gmail.com>:
> 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-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.
>

-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.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.
Received on Thu 05 May 2011 - 06:25:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 05 May 2011 - 07:00:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive