Regression: checking effect of negative vs positive regressor 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.
 A: 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. 
A: 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. 

