I'm trying to simulate a dataframe with columns x
and y
based on a real-world dataset. Fitting a negative binomial regression model onto the real world dataset produced a coefficient of 0.1922
with a standard error of 0.0268
.
Now I want to create an artificial dataframe based on this finding to run some follow up analyses. So far I've done the following to generate hypothetical y
values:
y <- rlnorm(1000000) # generate 1,000,000 numbers from log normal distribution
y <- y*10 # multiply by ten to get more realistic numbers
y <- round(y, digits = 0) # round to whole number
hist(y) # take a look
How can I use the results of the negative binomial regression to map my simulated y
values onto simulated x
values?
FYI: If you need it, you can find a good overview of the negative binomial regression here