[R] Comparing switchpoints from segmented

vito muggeo vmuggeo at dssm.unipa.it
Fri Mar 14 16:11:41 CET 2008


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,
best,

vito


> 
> 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: http://webspace.qmul.ac.uk/rknell/
> 
> "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]]
> 
> ______________________________________________
> 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.
> 
> 

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



More information about the R-help mailing list