[R-sig-ME] transforming predicted values of a glmm lme4

Ben Bolker bbolker at gmail.com
Tue May 17 14:47:08 CEST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/17/2011 08:46 AM, Michael Gerisch wrote:
> Dear list,
> 
> I calculated predicted values from a poisson glmm (glmer) like this:
> 
> predvals <- model.matrix ( terms ( fm1 ) , data2 ) %*% fixef ( fm1 )
> 
> whereas fm1 is my model & data2 is my new dataframe used for prediction.
> 
> When using the predict function, e.g. for glms, there is the option to set 
> type="response", which is nice, as you get your predicted values on the scale 
> of the response variable. Which means counts in my case. 
> 
> Alas, there is obviously no such possibility for a mer-object in lme4 and my 
> question is how I can transform my predicted values "by hand" to the scale of 
> the response variable.
> 
> Thanks in advance & cheers
> Michael
> 

 The default link for a Poisson GLM(M) is log, so just exponentiate.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3SbkwACgkQc5UpGjwzenPXXgCePzNS64W0IHXWs22gZnIUUoV/
P/EAoIBRVTTnIdG1kUShLvv/60UCzRVJ
=vEeP
-----END PGP SIGNATURE-----




More information about the R-sig-mixed-models mailing list