That isn't how poisson regression works. The link function for poisson regression is the log, so if you did something like
model<- glm(y~x, family = 'poisson')
Then you would recover the proper estimates for the coefficient of x and the intercept.
You could however recover ...
The default link function is the log function for Poisson, this means:
If you specify your glm model as y ~ log(x) then you should recover "1" as the coefficient and "log(5)" as the intercept
I believe the issue is coming in because you are representing events as rates where you have 0 events.
Let's walk through how the offset is added (following the notation from the linked answer):
A poisson regression of the form: $log(\mu_x) = \beta_0 + \beta_1x$ is adjusted for different measurement times by correcting the expected counts ($\mu_x$) for the ...
Yes it can and you can encode it using an indicator variable. Basically you have a variable that is 1 when the data point is in a certain category and 0 if it is not. Wikipedia provides a nice explanation and example:
For a more specific example/elaboration please see here:
Yes, they can be categorical ... as in all linear and generalized linear models. In fact, you can continue generalizing/extending the family of regression models, and it will still be true. As long as your model uses a matrix of predictor variables, all the coding trick you have learnt for usual linear regression can be applied. You can represent categorical ...