Description Usage Arguments Details Value Examples
Fit a simple linear segmented regression (also known as changepoint, hockey stick, or broken line regression).
1 |
x |
Numeric vector, the independent variable which will be "broken". |
y |
Numeric vector, the dependent variable which will be used to define the break point. |
k |
Numeric scalar, the location of the break point, if known. If NULL, the default, the optimal break point will be chosen from among all unique values of x except for the minimum and the maximum. |
The break point cuts the x vector into two groups, x <= k and x > k.
List with three elements, fit: the resulting lm object, k, and pred: data frame with the unique values of x (and k) with predicted values.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.