Skip to main content
1 of 3
Michael
  • 2.5k
  • 4
  • 26
  • 34

Generate data samples from Poisson Regression

I was wondering how you would generate data from a Poisson Regression equation in R? I'm kind of confused how to approach the problem.

So if I assume we have two predictors X1 and X2 which are distributed N(0,1). And the intercept is 0 and both of the coefficients equal 1. Then my estimate is simply:

log(Y) = 0+ 1X1 + 1X2

But once I have calculated log(Y) - how do I generate poisson counts based on that? What is the rate parameter for the Poisson distribution?

If anyone could write a brief R script that generates Poisson Regression samples that would be awesome!

Thanks!

Michael
  • 2.5k
  • 4
  • 26
  • 34