2
$\begingroup$

Given the model $$Y = a + \beta_1 x_1 + \beta_2 x_2 + \beta_3 \cos(\angle) + \beta_4 \sin(\angle) + \text{ errors}$$ resulting from a negative binomial regression, how can I explain the $\beta_3 \cos((\angle) + \beta_4 \sin(\angle)$ terms given that they are the two predictors emerging from the angle of inclination $\angle$ (a variable measured in the raw dataset)?

$\endgroup$
  • $\begingroup$ Welcome to the site, Gsenka. It's not clear to me what you are asking - please can you give a bit more detail about what you are trying to achieve and what it is that you don't understand/are struggling to interpret? Are you really fitting three constants (a, β1 and β2), and if so why? $\endgroup$ – Izy May 21 at 11:05
  • 1
    $\begingroup$ You have previously been pointed to an answer (and further linked information) by Nick Cox. If you are struggling with the concepts in that, please clarify what it is that you need help to understand. $\endgroup$ – Izy May 22 at 15:12
  • $\begingroup$ If you are struggling to understand how to interpret a regression where you have two terms reliant on the value of a single explanatory variable ((∠) in your case), try taking a look at this post. $\endgroup$ – Izy May 22 at 15:15
4
$\begingroup$

The question is a good one: when including an angular variable $w$ among the explanatory variables in any regression model by incorporating its sine and cosine, how does one interpret the two estimated coefficients?

Let's write this mathematically just to make things perfectly clear. Suppose you model a response $Y$ in the form

$$Y = X\beta + \alpha_1 \cos(w) + \alpha_2 \sin(w) + \text{ random error}$$

and (somehow) you estimate the parameters as $b, a_1, a_2$ to obtain the fit

$$\hat Y(X,w) = Xb + a_1 \cos(w) + a_2\sin(w) + \text{ residuals}.$$

What do the $a_i$ mean when you're interested in the relationship between $w$ and $Y$?

Typically, we express such relationships differentially by stating what happens to $\hat Y$ when (hypothetically) the value of $w$ is changed a tiny bit, say to $w+\delta$ for a small angle $\delta.$ We can work this out trigonometrically. Note that all the change occurs in just the two angular terms of the model ($Xb$ is not involved), so let's focus on how the angular terms differ.

When angles are expressed in radians we may feel free to treat $\sin(\delta)$ as approximately $\delta$ and $\cos(\delta)$ as approximately equal to $1,$ because the relative error made in either instance is proportional to $\delta^2,$ which is truly tiny. Trigonometry tells us that

$$\cos(w+\delta) - \cos(w) = \cos(w)\cos(\delta) - \sin(w)\sin(\delta) - \cos(w) \approx - \sin(w)\delta$$

and

$$\sin(w+\delta) - \sin(w)=\sin(w)\cos(\delta) + \cos(w)\sin(\delta) - \sin(w) \approx \cos(w)\delta.$$

Consequently the difference in the fit induced by changing the angle $w$ by a small amount of $\delta$ radians is $$\hat Y(X,w+\delta) - \hat Y(X,w) \approx (-a_1\sin(w) + a_2\cos(w))\,\delta.$$

To interpret this further, it's handy to re-express the $a_i$ in polar coordinates where $a_1 = r\cos(\phi)$ and $a_2=r\sin(\phi)$ for some non-negative number $r$ and angle $\phi.$ This can always be done by taking $r = \sqrt{a_1^2+a_2^2}$ and then computing $\phi$ as the arctangent of the vector $(a_1, a_2)$ or, equivalently, as the argument of the complex number $a_1 + a_2\mathbf{i}.$ The change in response can now be expressed as

$$\hat Y(X,w+\delta) - \hat Y(X,w) \approx (-a_1\sin(w) + a_2\cos(w))\ \delta = -\sin(w-\phi)\, r \ \delta.$$

(When measuring in degrees, multiply $\delta$ by $180/\pi \approx 57.3.$)

If that sine term weren't there, we would be looking at a traditional expression: the change $r\delta$ in $\hat Y$ is $r$ times the change in $w.$ This is modified by the sine term, though, but it's not difficult to understand: it is zero when $w=\phi,$ increases to $1$ when $w$ is 90 degrees clockwise of $\phi$ ($w=\phi+\pi/2$), returns to $0$ when $w$ is directly opposite $\phi$ ($w=\phi+\pi$), decreases to $-1$ when $w$ is 90 degrees counterclockwise of $\phi$ ($w=\phi + 3\pi/2$), and finally returns to $0.$

Thus, $\phi$ is a kind of origin of the angular effect: when $w=\pm \phi,$ a little change in $w$ doesn't appreciably change the response, whereas otherwise the change depends on how far away from the origin $w$ is, swinging back and forth between $-r$ and $r.$

We can summarize this simply:

A small change in the angle $w$ changes the fit $\hat Y$ by an amount between $-r$ and $r,$ where $r^2 = a_1^2 + a_2^2$ and the change is measured in radians. That amount depends on where $w$ is situated relative to the angle made by the vector $(a_1, a_2)$ in the plane counterclockwise of the vector $(1,0)$ (that is, "north of east" in geographers' terms).

$\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.