I'm fitting a linear model of the following form:

$Y_{i} = \alpha + \beta_1X_{i} + \beta_2Z_{i} + \beta_3X_{i}\times Z_{i}+e_i$

All the variables are continuous. I'm interested in the sign of the coefficient of the interaction term. My hypothesis predicts it to be positive. And I find that to be the case. Now, as a second step, I would like to find out if the results are driven by the observations having $X_i$ larger than a certain threshold. Say the threshold is 0. My question is then how to specify the regression.

So far I defined a two new variables $X_i^+ = max(X_i, 0)$ and $X_i^- = min(X_i, 0)$ and used them both as main effects and interacted with $Z_i$.

My question is whether this is the proper way to test it, and whether OLS is still valid as estimation method. Is this an instance of piecewise linear regression?

Any help would be greatly appreciated.


Yes this is an instance of a piecewise linear model, also called threshold regression, or segmented regression. If you impose a-priori the threshold value of 0, then you can run simple hypothesis tests. Youhave two possible formulations:

  • Use $X^+$ and $X^-$ in your model. Then run a Wald test for $\beta^+=\beta^-$
  • Use $X$ and $X^+$, then simply test for $\beta^+=0$ with the usual t-statistic printed by default by most software.

On the other side, if you want to estimate the threshold value itself (say using grid search methods for every possible candidate), then you can't just use standard hypothesis tests, precisely because you have already been searching for the value that gives the highest t-test. You would need a specific test procedure, see for example the work of Hansen (1999).

Note that this discussion is very similar to the one in the structural change/time break literature, where testing for a break at a specific time, versus estimating the date of the change, leads to different tests.

  • Hansen (1999) " Testing for Linearity," Journal of Economic Surveys, Wiley Blackwell, vol. 13(5), pages 551-576, December.
  • $\begingroup$ Thanks, I don't use R, but given your answer I'm undecided on whether the model should be specified as $Y_i=\alpha+\beta_1X_i^++\beta_2X_i...$ ect or as $Y_i=\alpha+\beta_1X_i^++\beta_2X_i^-...$, i.e. I keep the original $X_i$ plus and an additional term which is its positive part or I should split them. Any tips? $\endgroup$ – Ali Gröch Sep 27 '19 at 15:33
  • $\begingroup$ Edited the post, I hope this answers your question? $\endgroup$ – Matifou Sep 27 '19 at 16:45
  • $\begingroup$ Definitely, thanks! $\endgroup$ – Ali Gröch Sep 28 '19 at 14:03

If you fit your model with the original predictor variables $X$ and $Z$, it will have the form:

$Y_{i} = \alpha + \beta_1X_{i} + \beta_2Z_{i} + \beta_3X_{i}\times Z_{i}+e_i$

Using this model, you can easily test your first research hypothesis by performing a test of hypotheses, whose null and alternative hypotheses are specified as below:

Ho: $\beta_3 \leq 0$

Ha: $\beta_3 > 0$

For your second step, if you re-write your model, you'll get:

$Y_{i} = \alpha + \beta_1X_{i} + (\beta_2 + \beta_3X_{i}) \times Z_{i}+e_i$

This re-expression of the model shows more explicitly that the effect of $Z$ on $Y$ depends on X (which is to be expected in the presence of a significant interaction in your model).

You can plot the estimated value of $\beta_2 + \beta_3X$ versus $X$ for a range of values of $X$ consistent with the range of observed values of $X$ - this will enable you to see how the strength of the effect of $Z$ on $Y$ is influenced by the magnitude of $X$. You can show your threshold for $X$ values on this plot via a vertical line (e.g., a vertical line passing through 0) and then report how the estimated value of $\beta_2 + \beta_3X$ behaves before and after this threshold.

  • $\begingroup$ Thanks for your answer, I think my question was not clear, I'm interested only in the second step as the first one is relatively straightforward and I already carried that out. Second, the plot you propose would be just line with intercept $\beta_2$ and slope $\beta_3$? I'm rather interested in how the estimated coefficient of the slope would change depending on whether $X$ is positive or negative. Cheers $\endgroup$ – Ali Gröch Sep 25 '19 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.