Skip to content
Back to formatted view

Raw Message

Message-ID: <4DD26E4C.2000901@gmail.com>
Date: 2011-05-17T12:47:08Z
From: Ben Bolker
Subject: transforming predicted values of a glmm lme4
In-Reply-To: <201105171446.19384.michael.gerisch@ufz.de>

-----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-----