[R] random generation for a quasi distribution
Spencer Graves
spencer.graves at pdf.com
Sat Jun 10 22:29:04 CEST 2006
Any "quasi distribution" is not well defined, which is why it is
called "qausi". Users decide that its likelihood "looks like" some
other distribution, e.g. a Poisson, but it is "overdispersed".
If you want to simulate a "quasi binomial", you have to select a
plausible "overdispersion" mechanism. You could for example decide that
the Poisson parameter follows a lognormal or a gamma distribution. Then
simulate the lognormal or gamma random variables and use those to
simulate the poisson.
Example:
> set.seed(5)
> (Lam <- rlnorm(2, sdlog=9))
[1] 5.168803e-04 2.576182e+05
> rpois(2, Lam)
[1] 0 257885
hope this helps
Spencer Graves
hugues wrote:
> Dear R-Help,
>
> As with the rpois() function to generate random data for a poisson
> distribution, I need to generate random data for a quasi distribution with
> var=mu^2.
> Does anyone known how to do this?
>
> Thanks in advance,
>
> Hugues SANTIN-JANIN.
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
More information about the R-help
mailing list