Skip to Content

Estimating breakpoints on repeated measures data in R

Well,

I restart again whit more details, sorry if this post is to general in a first place.
Like i said , I have some repeated measures to deal with 196 individuals and some of my regressions have a plateau and I want to characterize an eventual breakpoint on each ID.

Example: subset of my personal data

  ID     time   y
7G009   0       9
7G009   108,33  13
7G009   185,69  16
7G009   309,22  20
7G009   515,08  21
7G051   0       10
7G051   108,33  14
7G051   185,69  19
7G051   309,22  23
7G051   515,08  25
8S027   0       8
8S027   108,33  13
8S027   185,69  17
8S027   309,22  22
8S027   515,08  23

I test for example with the strucchange package( breakpoint()) , or with the segmented package(segemented()). I try also with the siZer package (piecewise.linear) it’s ok with one ID, but I am stuck when i want to deal with all my IDs.

My first attempt was with using the code in the review named segmented: An R Package to Fit
Regression Models with Broken-Line Relationship by Vito M. R. Muggeo.

Cf page 23: http://ftp.csie.ntu.edu.tw/pub/R/CRAN/doc/Rnews/Rnews_2008-1.pdf#page=20

> data("plant")
> attach(plant)
> X<-model.matrix(~0+group)*time
> time.KV<-X[,1]
> time.KW<-X[,2]
> time.WC<-X[,3]

But i am stuck to build my 196 different explanatory variables …

Old version :

"""I have some repeated measures to deal with 196 individuals and some of my regressions have a plateau and I want to know an eventual breakpoint.

I spent a lot of time reading forums about breakpoint (piecewise regression), the different R packages like the strucchange or segmented package, but I can't find a way to solve my problem.

My question (and my personal data) a really close to this post:

http://stats.stackexchange.com/questions/19772/estimating-the-break-point-in-a-broken-stick-piecewise-linear-model-with-rando

But my purpose is to estimate one breakpoint for each individual and not only one breakpoint for the entire set."""

Well, if anybody can tell me how deal with it

Thank you in advance. I hope to be clearer this time

Sorry for the poor English.