Re: [Rd] proposed simulate.glm method

2009-02-14 Thread Nicholas Lewin-Koh
object to simulate from? Nicholas Message: 9 Date: Fri, 13 Feb 2009 21:27:57 +0100 From: Martin Maechler maech...@stat.math.ethz.ch Subject: Re: [Rd] proposed simulate.glm method To: Heather Turner heather.tur...@warwick.ac.uk Cc: r-devel@r-project.org, Martin Maechler maech

Re: [Rd] proposed simulate.glm method

2009-02-14 Thread Martin Maechler
Maechler maech...@stat.math.ethz.ch Subject: Re: [Rd] proposed simulate.glm method To: Heather Turner heather.tur...@warwick.ac.uk Cc: r-devel@r-project.org, Martin Maechler maech...@stat.math.ethz.ch Message-ID: 18837.55245.15158.29...@cmath-5.math.ethz.ch Content-Type

Re: [Rd] proposed simulate.glm method

2009-02-14 Thread Nicholas Lewin-Koh
...@stat.math.ethz.ch Subject: Re: [Rd] proposed simulate.glm method To: Heather Turner heather.tur...@warwick.ac.uk Cc: r-devel@r-project.org, Martin Maechler maech...@stat.math.ethz.ch Message-ID: 18837.55245.15158.29...@cmath-5.math.ethz.ch Content-Type: text/plain

Re: [Rd] proposed simulate.glm method

2009-02-14 Thread Prof Brian Ripley
asked.. Martin NicLK Nicholas Message: 9 Date: Fri, 13 Feb 2009 21:27:57 +0100 From: Martin Maechler maech...@stat.math.ethz.ch Subject: Re: [Rd] proposed simulate.glm method To: Heather Turner heather.tur...@warwick.ac.uk Cc: r-devel@r-project.org, Martin Maechler maech

Re: [Rd] proposed simulate.glm method

2009-02-13 Thread Martin Maechler
BB == Ben Bolker bol...@ufl.edu on Thu, 12 Feb 2009 11:29:14 -0500 writes: BB I have found the simulate method (incorporated BB in some packages) very handy. As far as I can tell the BB only class for which simulate is actually implemented BB in base R is lm ... this is

Re: [Rd] proposed simulate.glm method

2009-02-13 Thread Heather Turner
Dear Martin, I think a simulate.glm method ought to be able to work for gnm objects too. David Firth and I started to work on this a long time ago, but stopped part-way through when simulate.lm was introduced, thinking that simulate.glm was probably in the pipeline and we were duplicating effort.

Re: [Rd] proposed simulate.glm method

2009-02-13 Thread Martin Maechler
Thanks a lot, Heather, HT == Heather Turner heather.tur...@warwick.ac.uk on Fri, 13 Feb 2009 11:49:06 + writes: HT Dear Martin, HT I think a simulate.glm method ought to be able to work for gnm objects HT too. David Firth and I started to work on this a long time ago, but

Re: [Rd] proposed simulate.glm method

2009-02-13 Thread Heather Turner
Yes, thanks to Ben for getting the ball rolling. His code was more streamlined than mine, pointing to further simplifications which I've included in the extended version below. The code for the additional families uses functions from MASS and SuppDists - I wasn't sure about the best way to do

Re: [Rd] proposed simulate.glm method

2009-02-13 Thread Paul Gilbert
If you are generalizing this, the saving of the RNG information to reproduce normally distribution random number also needs to save the normal generator information. (This looks like an omission in simulate.lm.) You might want to consider adding the simple functions setRNG and getRNG from my

Re: [Rd] proposed simulate.glm method

2009-02-13 Thread Martin Maechler
Thank you, Heather and Ben, HT == Heather Turner heather.tur...@warwick.ac.uk on Fri, 13 Feb 2009 15:52:37 + writes: HT Yes, thanks to Ben for getting the ball rolling. His HT code was more streamlined than mine, pointing to further HT simplifications which I've included in

[Rd] proposed simulate.glm method

2009-02-12 Thread Ben Bolker
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

Re: [Rd] proposed simulate.glm method

2009-02-12 Thread Alex D'Amour
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