[R] piecewise regression

Spencer Graves spencer.graves at structuremonitoring.com
Fri Jan 14 17:25:00 CET 2011


Hello:


       I just found 58 help pages in 32 contributed packages containing 
the terms "piecewise" and "regression", as follows:


library(sos)
pr <- ???'piecewise regression' # for "piecewise" with "regression"
summary(pr) # 58 matches in 32 packages
pr # view the 58 links sorted by package in a web browser

p.r <- ???"{piecewise regression}" # for "piecewise" followed immediate 
by "regression"
summary(p.r) # 15 matches in 13 packages
p.4 # to view in a web browser


       Beyond this, the "structchange" package supports looking for 
changes that would be, e.g., linear in one segment then jump to a 
different linear regime.  If you want the lines to connect, then you may 
want splines.  Probably the most common spline is cubic, but you can 
also get linear splines.  One of the most general spline packages is 
"fda" (functional data analysis), with multiple companion books by James 
Ramsay and others.  However, there are other spline packages.


       If this does not answer your question, "PLEASE do read the 
posting guide http://www.R-project.org/posting-guide.html and provide 
commented, minimal, self-contained, reproducible code", as it says in 
the signature block for each email on this list.


       Hope this helps.
       Spencer Graves


On 1/14/2011 6:42 AM, Federico Bonofiglio wrote:
> Hello everybody!!!!
>
> Quick question, if you'd like to throw a little tip:
>   does anyone knows a function that runs piecewise regression models with
> coefficients estimation and inferences ?
>
> Thank you
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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