I am developing a mixed-effects binomial logistic regression (using glmmTMB, family = binomial) where the response is presence-absence. One of my potential predictors is hour of day, which takes values from 0 to 23.
z$newHour <- 2 * pi * (z$Hour / 24)
m1.glmm <- glmmTMB(pa~ (1 | FishID) + Year + sin(newHour) +
cos(newHour) + Sex + tempC + I(tempC**2),
family = binomial, data = z, na.action = na.fail)
One of the answers to the post here:
Regression using circular variable (hour from 0~23) as predictor suggests mapping the circular predictor to the interval to (0, 2pi) and including two terms in the model—one for the sine of the transformed predictor and one for the cosine of the transformed predictor.
I have followed that advice and run the model. In performing significance testing for covariates, only the sine of the transformed predictor (not the cosine of the transformed predictor) comes out as significant. Is this possible and does it make sense?
I also have a question regarding the construction of the associated predictor effect plot. Currently, the x-axis of the plot is on the transformed scale. Is it possible to convert it in some way so the x-axis is on the 0 to 23 scale?