1
$\begingroup$

With a model such as:

$y \approx B_0 + B_1\cdot \log(x) + B_i\cdot \log(x):\text{group}_i +B_j\cdot group_i$, where group can take on several values ($i = 2$ to $15$, let's say):

In an OLS regression, a statistically significant coefficient on any one of the interaction terms $B_2$ through $B_{15}$ means I know up to an acceptable level of Type 1 error that the coefficient is not 0.

In this particular model, the theory suggests that the slope between $y$ and $\log(x)$ in every group should be negative. So I want to test the hypothesis that $B1 + B2 < 0$, for instance, indicating that I'm confident the relationship between $y$ and $\log(x)$ in group 2 is negative.

How can I accomplish such a test? It would be even more helpful if you have specific guidance on how to do so in Python's statsmodels package.

$\endgroup$
1
  • $\begingroup$ There is. sorry i'll edit the formula now $\endgroup$
    – AllenQ
    Feb 1 '14 at 18:45
1
$\begingroup$

The term that you are looking for is "General Linear Hypothesis", you can google on it, or look in the documentation for the tool that you are using (I know there are tools in R that do this for you, don't know about python), or look for it in your regression textbook.

Basically this lets you test any linear combination of parameters, in your case you will have a 1 for B1 and a 1 for B2 and 0's for all other parameters. Most examples use a 2 tailed alternative, but you can modify it to do one sided.

$\endgroup$

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.