# Integer predictors in Poisson regression

I am trying to fit a model of total rental bike with ten predictors using Poisson Regression. Four of them are integer :

• Season : 1-4
• Month : 1-12
• Day : 0-6
• Hour : 0-23

I usually treat integer variable as factor in R. But in this case, if I treat 'Month' and 'Hour' as factors, they will have many levels. But if I divide them into several groups (say, for variable 'Hour' : peak hour and non-peak hour), I'm afraid that the data will lose information.

There might be some alternative ways to analyse this kind of data, such as periodic formula. But unfortunately, I'm only allowed to use Poisson regression here.

So, is there any suggestions to properly treat these integer predictors in my analysis?

• There's no such thing as a "periodic formula" in terms of a set of regressors, but you can use methods for periodic modeling as have been discussed in other SE posts, one from me is here. These can be applied to Poisson GLMs. – AdamO Mar 2 '18 at 21:28

library(pbs) # periodic splines basis functions