[R-sig-ME] Use of offset variable when analysing rates in lme4
Thierry.ONKELINX at inbo.be
Thu Apr 3 14:22:56 CEST 2014
Your model is
visits ~ Pois(lamba)
log(lambda) = mu = beta_i * treat + beta_j * timecat + log(infl)
which can be rewritten to
log(lambda) - log(infl) = mu - log(infl) = beta_i * treat + beta_j * timecat
log(lambda) - log(infl) = log(lambda / infl) = log(visitation rate)
hence beta_i and beta_j are effects in log(visitation rate). Exponentiating the results from glht should give you the relative effects on the visitation rate.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx op inbo.be
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
Van: r-sig-mixed-models-bounces op r-project.org [mailto:r-sig-mixed-models-bounces op r-project.org] Namens De Waal, C, Mej <caroli op sun.ac.za>
Verzonden: woensdag 2 april 2014 11:50
Aan: r-sig-mixed-models op r-project.org
Onderwerp: [R-sig-ME] Use of offset variable when analysing rates in lme4
This is my first post to the list as I have been unsuccessful in getting an answer elsewhere. I am also quite new to R.
I am investigating variation in pollinator visitation rate (number of visits per inflorescence) with treatment and time category as fixed factors. Block is a random factor. Following Zuur et al (2009), I used the number of visits as response variable with the log(number of inflorescences) as offset variable. A poisson model was overdispersed, and therefore I opted for a negative binomial model in lme4, as follows:
model1 = glmer.nb(visits ~ treat + timecat + offset(log(infl)) + (1|block))
I am specifically interested in differences in visitation rates between treatments. I therefore performed a post hoc test:
OPexp1 = glht(model1,mcp(treat = "Tukey"))
When I plot these results, I get number of visits on the y axis. But what I want is visitation rate (visits per inflorescence). How do I specifiy that the post hoc test should be performed using visitation rate?
I assume what is happening is that fitted values are currently expressed as μ × V, but how to I specify that they should be expressed as μ (visits per inflorescence) only? On p 240, Zuur et al (2009) mentions that this is possible, but I have not been able to find an example.
Any advice would be much appreciated.
Caroli de Waal
University of Stellenbosch, South Africa The integrity and confidentiality of this email is governed by these terms / Hierdie terme bepaal die integriteit en vertroulikheid van hierdie epos. http://www.sun.ac.za/emaildisclaimer
[[alternative HTML version deleted]]
R-sig-mixed-models op r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.
More information about the R-sig-mixed-models