Alternatively, you can apply the linkinv component of the family returned by
poisson(). This approach has the advantage that it can be applied with other
families, even if you don't know what the link and inverse link are
(although, really you should know that if you are using them).
On May 17, 2011 7:48 AM, "Ben Bolker" <bbolker@gmail.com> wrote:
> -----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-----
>
> _______________________________________________
> R-sig-mixed-models@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

	[[alternative HTML version deleted]]


