[Rd] proposed simulate.glm method

Alex D'Amour adamour at iq.harvard.edu
Thu Feb 12 18:11:09 CET 2009

There is functionality similar to this included in the Zelig package
with it's "sim" method. The "sim" method goes a step further and
replicates the fitted model's analysis on the generated datasets as
well. I would suggest taking a look -- Zelig supports most (if not
all) glm models and a wide range of others.

The Zelig maintainers' site can be found at: http://gking.harvard.edu/zelig/.

Full disclosure: I am an employee of the Institute for Quantitative
Social Science, which performs most of the development and support for
the Zelig package.

Alex D'Amour
Statistical Programmer
Harvard Institute for Quantitative Social Science

2009/2/12 Ben Bolker <bolker at ufl.edu>:
>  I have found the "simulate" method (incorporated
> in some packages) very handy. As far as I can tell the
> only class for which simulate is actually implemented
> in base R is lm ... this is actually a little dangerous
> for a naive user who might be tempted to try
> simulate(X) where X is a glm fit instead, because
> it defaults to simulate.lm (since glm inherits from
> the lm class), and the answers make no sense ...
> Here is my simulate.glm(), which is modeled on
> simulate.lm .  It implements simulation for poisson
> and binomial (binary or non-binary) models, should
> be easy to implement others if that seems necessary.
>  I hereby request comments and suggest that it wouldn't
> hurt to incorporate it into base R ...  (I will write
> docs for it if necessary, perhaps by modifying ?simulate --
> there is no specific documentation for simulate.lm)
>  cheers
>    Ben Bolker
> --
> Ben Bolker
> Associate professor, Biology Dep't, Univ. of Florida
> bolker at ufl.edu / www.zoology.ufl.edu/bolker
> GPG key: www.zoology.ufl.edu/bolker/benbolker-publickey.asc
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

More information about the R-devel mailing list