Skip to content
Prev 189826 / 398498 Next

Simulating points from GLM corresponding to new x-values

Hi Cliff -- thanks for the suggestion.

I tried extracting the predicted mean and standard error using  
predict(). Afterwards I simulated the dependent variable using  
rnorm(), with mean and standard deviation taken from the predict()  
function (sd = sqrt(n)*se). The points obtained this way were  
scattered far too much (compared to points obtained with simulate())  
-- I am not quite sure why.

Unfortunately the documentation of the simulate() function does not  
provide much information about how it is implemented, which makes it  
difficult to judge which method is best (predict() or simulate(), and  
it is also unclear whether simulate() can be applied to glms (with  
family=gaussian or binomial).

Any suggestions for how to proceed?

Jacob
On 12 Aug 2009, at 13:11, Clifford Long wrote: