2
$\begingroup$

I am working on a multi-level logistic regression model with a binary outcome and a circular predictor. Thanks to this post, I know that I have to add sine and cosine of the circular variable as a predictor and that I can calculate the amplitude $a$ and the phase shift $\phi$ from the regression weights $w_1$ and $w_2$ corresponding to the sine and cosine predictors, respectively.

$a = \sqrt{w_1^2 + w_2^2}$

$\phi = \tan^{-1}\frac{w_1}{w_2}$

Say I am not particularly interested in testing the significance of sine and cosine components individually, which is what the model provides. Instead, I would like to test the overall effect of the circular variable (i. e., the amplitude). My thought was to run a model comparison (in R, anova(m1, m2)) between an intercept-only model m1 and the model including the circular variable m2 to obtain a $\chi^2$ statistic. However, I would like to know if there is a cleaner way of testing the significance of $a$ and $\phi$ - and how the corresponding standard errors are calculated. Thanks in advance for your help!

$\endgroup$
3
  • $\begingroup$ What is the likelihood for your observations? How do you model your errors? I think you will need to be more explicit about the data and the model. Also, bear in mind that, if you have a clear model for your errors, you can simply simulate the data under null hypothesis, extract sampled $a$ from that, and extract confidence intervals and standard errors that way. $\endgroup$
    – Cryo
    Oct 11, 2023 at 18:35
  • $\begingroup$ I am using R and am running glmer(binary_outcome ~ sin + cos + (1|ID), family = "binomial", data) where sin and cos stand for the sine and cosine predictor and ID is the subject identifier. The probability of a positive outcome (=1) is around 20 % in my data. I have not explicitly modeled error. $\endgroup$ Oct 11, 2023 at 19:10
  • $\begingroup$ I am not an R user, so it does not give me enough information. $\endgroup$
    – Cryo
    Oct 11, 2023 at 19:28

2 Answers 2

2
$\begingroup$

The relevant tests can be undertaken by converting them to tests on the underlying regression coefficients in linear form. For the test of amplitude the relevant null hypotheses convert as follows:

$$\begin{matrix} H_0: a = 0 \quad \quad \quad & & & H_A: a \neq 0 \quad \quad \quad \quad \quad \\[6pt] H_0: w_1=w_2=0 & & & H_A: w_1 \neq 0 \text{ or } w_2 \neq 0 \\[6pt] \end{matrix}$$

You can test this hypothesis with a standard F-test for the subset of the two coefficients for the sine and cosine terms. For the test of phase angle the relevant null hypotheses convert as follows:

$$\begin{matrix} H_0: \phi = \phi_0 \ \ \quad \quad \quad & & & H_A: \phi \neq \phi_0 \ \ \quad \quad \quad \\[6pt] H_0: w_1 = w_2 \tan \phi_0 & & & H_A: w_1 \neq w_2 \tan \phi_0 \\[6pt] \end{matrix}$$

This latter hypothesis test is effectively testing the ratio of the linear regression coefficients against a fixed value. This would require a custom test for a ratio of coefficients, which is non-standard but should not be too difficult to construct.

$\endgroup$
4
  • $\begingroup$ This is helpful. Could you elaborate on both tests? For the amplitude test, does that you would just check the p-value of each of the regression weights (representing sine and cosine) and call the amplitude significant if at least one of the regressors are significant? $\endgroup$ Oct 12, 2023 at 17:28
  • 1
    $\begingroup$ For the amplitude test, you would do a partial F-test on the two regression coefficients $w_1$ and $w_2$ together (not look at their individual p-values in t-tests) (see here). The phase angle test would be a bit more complicated (see here for some preliminary thoughts). $\endgroup$
    – Ben
    Oct 13, 2023 at 8:47
  • $\begingroup$ It seems like the partial F-test is used for multiple regression and based on your reference, can be derived from the likelihood ratio test. The equivalent likelihood ratio test for mixed effects models seems to be approximately $\chi^2$ distributed. With this comment I want to clarify - for the amplitude test, do you refer to a model comparison procedure or did you suggest something different? $\endgroup$ Oct 15, 2023 at 6:56
  • 1
    $\begingroup$ Sorry, I had thought your post referred to linear rather than logistic regression. Yes the appropriate test in this case is the likelihood ratio test using the chi-squared test statistic. $\endgroup$
    – Ben
    Oct 15, 2023 at 20:58
0
$\begingroup$

The little I did understand from googling on R is that the model here is that we have a binary outcome $Y_{ij}$ some sort of bounded variable $\theta_{ij}$. Where $j$ is the group within which random intercept is kept constant. So the model is:

$$ \begin{align} c_j&\sim N\left(\mu,\,\sigma^2\right) \\ \eta_{ij}&=c_j+w_1\sin\theta_{ij}+w_2\cos\theta_{ij}\\ \pi_{ij}&=logit\left(\eta_{ij}\right)\\ Y_{ij}&\sim Bernoulli(\pi_{ij}) \end{align} $$

Where $\mu$, $\sigma$, $w_{1,2}$ are to be fitted

With some work you could write the likelihood for your data under this model and then use something like Fisher Information to extract the standard errors. It also, so happens that for Bernoulli, the algebraic expressions can be relatively simple

Instead, it may be easier to supplement this model with $\theta_{ij}\sim Uniform\left(0,2\pi\right)$ generate some $Y_{ij}$, and then use your current fitting procedure to get estimates of $w_{1,2}$. Their distribution, and distribution of their sum of squares will tell you the distributions of the statistics under null hypothesis.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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