Re: [R] Comparing switchpoints from segmented

From: vito muggeo <>
Date: Fri, 14 Mar 2008 16:11:41 +0100

Dear Rob,

Rob Knell ha scritto:
> Hello everyone
> Not strictly an R question but close... hopefully someone will be able
> to help. I wish to compare the switchpoints in two switchpoint
> regressions. The switchpoints were estimated using the segmented
> library
It's a package.

running in R, and I have standard errors for the estimates. I
> initially thought I could just bootstrap confidence intervals for the
> difference between the switchpoints, but I have been having trouble
> with getting this to work because for about 25% of the bootstrap
> samples the algorithm in segmented fails to converge. So I had another
> think, and I thought that maybe I could just do a t-test: knowing the
> estimated switchpoints and their
> standard errors I can easily calculate the SE of the difference, so I
> can calculate a t-value using that. My question is whether there is
> anything wrong with doing it this way, and if not, how many degrees of
> freedom should I use? I would guess at df=n1-5+n2-5 5 df lost for each
> sample because two slopes, two intercepts and one switchpoint have
> been estimated, but I'm not sure: I'm but a humble biologist and not
> very good at this sort of thing.

The SE() of the breakpoints are reliable only for large samples and/and with clear-cut relationships. Having said that, I think that you can compare them by using the approximate t-like studentized statistic, but results have to taken with care.. The relevant sampling distribution is unknown (it depends on the location of the breakpoint, (standardized) difference-in-slope, sample size and, to some extend, distribution of the `segmented variable') . Therefore quantiles of a t distributions are not appropriate in theory, but in practice someone uses them..BTW the model parameters are 4 (intercept+two slopes+ breakpoint, the regression lines are joined at the breakpoint).
Hope this helps you,


> Any help gratefully received
> Thanks
> Rob Knell
> School of Biological and Chemical Sciences
> Queen Mary, University of London
> 'Phone +44 (0)20 7882 7720
> Skype Rob Knell
> Research:
> "The truth is that they have no clue why the beetles had horns, it's
> the researchers who have sex on the brain and everything has to have a
> sexual explanation. And this is reasearch?!" Correspondent known as
> FairOpinion on Neo-Con American website discussing my research.
> [[alternative HTML version deleted]]
> ______________________________________________
> mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.

Vito M.R. Muggeo Sc Statist e Matem `Vianelli'
UniversitÓ di Palermo
viale delle Scienze, edificio 13
90128 Palermo - ITALY
tel: 091 6626240
fax: 091 485726/485612

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 14 Mar 2008 - 15:14:30 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 Fri 14 Mar 2008 - 15:30:23 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive