Park, Kyong H Mr. RDECOM
2005-Jun-08 12:25 UTC
[R] Robustness of Segmented Regression Contributed by Muggeo
Hello, R users, I applied segmented regression method contributed by Muggeo and got different slope estimates depending on the initial break points. The results are listed below and I'd like to know what is a reasonable approach handling this kinds of problem. I think applying various initial break points is certainly not a efficient approach. Is there any other methods to deal with segmented regression? From a graph, v shapes are more clear at 1.2 and 1.5 break points than 1.5 and 1.7. Appreciate your help. Result1: Initial break points are 1.2 and 1.5. The estimated break points and slopes: Estimated Break-Point(s): Est. St.Err Mean.Vel 1.285 0.05258 1.652 0.01247 Est. St.Err. t value CI(95%).l CI(95%).u slope1 0.4248705 0.3027957 1.403159 -0.1685982 1.018339 slope2 2.3281445 0.3079903 7.559149 1.7244946 2.931794 slope3 9.5425516 0.7554035 12.632390 8.0619879 11.023115 Adjusted R-squared: 0.9924. Result2: Initial break points are 1.5 and 1.7. The estimated break points and slopes: Estimated Break-Point(s): Est. St.Err Mean.Vel 1.412 0.02195 1.699 0.01001 Est. St.Err. t value CI(95%).l CI(95%).u slope1 0.7300483 0.1381587 5.284129 0.4592623 1.000834 slope2 3.4479466 0.2442530 14.116289 2.9692194 3.926674 slope3 12.5000000 1.7783840 7.028853 9.0144314 15.985569 Adjusted R-squared: 0.995. [[alternative HTML version deleted]]
roger koenker
2005-Jun-08 12:36 UTC
[R] Robustness of Segmented Regression Contributed by Muggeo
You might try rqss() in the quantreg package. It gives piecewise linear fits for a nonparametric form of median regression using total variation of the derivative of the fitted function as a penalty term. A tuning parameter (lambda) controls the number of distinct segments. More details are available in the vignette for the quantreg package. url: www.econ.uiuc.edu/~roger Roger Koenker email rkoenker at uiuc.edu Department of Economics vox: 217-333-4558 University of Illinois fax: 217-244-6678 Champaign, IL 61820 On Jun 8, 2005, at 7:25 AM, Park, Kyong H Mr. RDECOM wrote:> Hello, R users, > I applied segmented regression method contributed by Muggeo and got > different slope estimates depending on the initial break points. > The results > are listed below and I'd like to know what is a reasonable approach > handling > this kinds of problem. I think applying various initial break > points is > certainly not a efficient approach. Is there any other methods to > deal with > segmented regression? From a graph, v shapes are more clear at 1.2 > and 1.5 > break points than 1.5 and 1.7. Appreciate your help. > > Result1: > Initial break points are 1.2 and 1.5. The estimated break points > and slopes: > > Estimated Break-Point(s): > Est. St.Err > Mean.Vel 1.285 0.05258 > 1.652 0.01247 > > Est. St.Err. t value CI > (95%).l > CI(95%).u > slope1 0.4248705 0.3027957 1.403159 -0.1685982 > 1.018339 > slope2 2.3281445 0.3079903 7.559149 1.7244946 > 2.931794 > slope3 9.5425516 0.7554035 12.632390 8.0619879 > 11.023115 > Adjusted R-squared: 0.9924. > > Result2: > Initial break points are 1.5 and 1.7. The estimated break points > and slopes: > > Estimated Break-Point(s): > Est. St.Err > Mean.Vel 1.412 0.02195 > 1.699 0.01001 > > Est. St.Err. t value CI > (95%).l > CI(95%).u > slope1 0.7300483 0.1381587 5.284129 0.4592623 > 1.000834 > slope2 3.4479466 0.2442530 14.116289 2.9692194 > 3.926674 > slope3 12.5000000 1.7783840 7.028853 9.0144314 > 15.985569 > > Adjusted R-squared: 0.995. > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting- > guide.html > >
Achim Zeileis
2005-Jun-08 12:55 UTC
[R] Robustness of Segmented Regression Contributed by Muggeo
On Wed, 8 Jun 2005 08:25:16 -0400 Park, Kyong H Mr. RDECOM wrote:> Hello, R users, > I applied segmented regression method contributed by Muggeo and got > different slope estimates depending on the initial break points. The > results are listed below and I'd like to know what is a reasonable > approach handling this kinds of problem. I think applying various > initial break points is certainly not a efficient approach. Is there > any other methods to deal with segmented regression? From a graph, v > shapes are more clear at 1.2 and 1.5 break points than 1.5 and 1.7. > Appreciate your help.When you keep the number of break points fixed, then there is a unique solution to the problem of fitting a segmented regression: the solution which maximizes the likelihood (or for linear models equivalently minimizes the RSS). Vito's segmented package gives an iterative method which can be shown to converge to this unique solution. If empirically you find different solutions with different starting values, you can always compare them using the RSS or log-likelihood and choose the one which fits better (because the other one can't be the optimal solution). The function breakpoints() in package strucchange computes (as opposed to approximates) the unique solution for a fully segmented model instead of a broken line trend. Another nonparametric solution using quantreg was already pointed out by Roger. hth, Z> Result1: > Initial break points are 1.2 and 1.5. The estimated break points and > slopes: > > Estimated Break-Point(s): > Est. St.Err > Mean.Vel 1.285 0.05258 > 1.652 0.01247 > > Est. St.Err. t value > CI(95%).l > CI(95%).u > slope1 0.4248705 0.3027957 1.403159 -0.1685982 > 1.018339 slope2 2.3281445 0.3079903 7.559149 1.7244946 > 2.931794 > slope3 9.5425516 0.7554035 12.632390 8.0619879 > 11.023115 Adjusted R-squared: 0.9924. > > Result2: > Initial break points are 1.5 and 1.7. The estimated break points and > slopes: > > Estimated Break-Point(s): > Est. St.Err > Mean.Vel 1.412 0.02195 > 1.699 0.01001 > > Est. St.Err. t value > CI(95%).l > CI(95%).u > slope1 0.7300483 0.1381587 5.284129 0.4592623 > 1.000834 slope2 3.4479466 0.2442530 14.116289 2.9692194 > 3.926674 > slope3 12.5000000 1.7783840 7.028853 9.0144314 > 15.985569 > > Adjusted R-squared: 0.995. > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >