Hello!
I am trying to identify a kink in a distribution. To do so, I installed the loghockey package, in order to perform a piecewise linear regressions. I am running Stata 13.1 on Windows 7.
Below is the code I used to run my piecewise regression (with an linear regression included for comparison). While the Scatter plot is not necessary, I attached an image of it to help motivate why I expected to find a kink in my data.
Stata code:
Unfortunately, my piecewise regression results appear to be incorrect. I identify a breakpoint (the value on the domain where the kink is, identified as c in nlhockey.hlp) of 1.007157, a value outside of my domain (domain has values between 1/7367 and 1). However, the slope to the left of the breakpoint (identified as b in nlhockey.hlp) does not match the slope of the linear regression.
I am not sure if I am doing something incorrectly. I went through the help file of nlhockey, and I could not find an explanation for this result. If any of you have any ideas or insights into the matter, I would appreciate your input!
Thanks!
I am trying to identify a kink in a distribution. To do so, I installed the loghockey package, in order to perform a piecewise linear regressions. I am running Stata 13.1 on Windows 7.
Below is the code I used to run my piecewise regression (with an linear regression included for comparison). While the Scatter plot is not necessary, I attached an image of it to help motivate why I expected to find a kink in my data.
Stata code:
Code:
sort y gen x = _n/_N nl hockey y x regress y x twoway (scatter y x)
I am not sure if I am doing something incorrectly. I went through the help file of nlhockey, and I could not find an explanation for this result. If any of you have any ideas or insights into the matter, I would appreciate your input!
Thanks!
Comment