0

Well,

I try to do some piecewise regression on my data to find eventual breakpoint for each ID and extract this information.

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

For that purpose , I used the breakpoints function of package strucchange and dlply , my code is the following :

breakby=dlply(test,.(subject),summarize,break=breakpoints(y~time,h=2))

but I get an error :

Erreur dans breakpoints.formula(nbf ~ cumggd, h = 2) :
minimum segment size must be greater than the number of regressors

Well, if anybody can tell me how deal with it

Thank you in advance.

Sorry for the poor English.

G5W
  • 36,531
  • 10
  • 47
  • 80
mat
  • 107
  • 1
  • 6
  • Do you know how to do what you want if you just had one ID to do this task for? – Dason Aug 08 '12 at 17:24
  • Yes , i know different way . i test for example with the strucchange package( breakpoint()) , or with the segmented package(with segemented()). I try also with the siZer package (piecewise.linear) but i am stuck when i want to deal with all my Ids – mat Aug 09 '12 at 06:56
  • Why don't you post the code you would use to test for a single ID and explain why you're having trouble doing the same type of thing over all the IDs – Dason Aug 09 '12 at 13:55
  • This may not be interesting for you any more, but I think the problem is the specification `h=2` - you have 2 regressors, so your h must be at least 3. – SiKiHe Apr 24 '15 at 13:12

0 Answers0