Message-ID: <81659553-DB84-4791-AC15-A2F2CE45596E@comcast.net>
Date: 2013-01-21T02:47:00Z
From: David Winsemius
Subject: strucchange breakpoints r-squared
In-Reply-To: <CAGRravam+um8WPt4MjhzHhwJH3EW60mZ8rGCeCLFVReFO6aGaQ@mail.gmail.com>
On Jan 20, 2013, at 3:05 PM, Geoffrey Smith wrote:
> Can anyone please tell me how to get the r-squared output from a
> piecewise
> (segmented) regression using the strucchange package? Here is the R
> code I
> have tried thus far.
>
> library(lmtest)
> library(strucchange)
>
> data <- ts(c(rnorm(30), runif(30)), frequency = 12, start = c(2005,
> 01))
>
> bpts <- breakpoints(data ~ 1)
>
> print(bpts)
>
> summary(bpts)
>
> coeftest(bpts)
The authors of that package do provide some summary statistics that
might be of interest. You can get the residual sums of squares:
summary(bpts)$RSS
You should also look at
?logLik.breakpoints
As Bert points out this is not an ordinary linear problem.
--
David Winsemius, MD
Alameda, CA, USA