Juan Pablo Edwards Molina
2017-Apr-21 18:57 UTC
[R] GLMM for Combined experiments and overdispersed data
I am analyzing data from 3 field experiments (farms=3) for a citrus flower disease: response variable is binomial because the flower can only be diseased or healthy. I have particular interest in comparing 5 fungicide spraying systems (trt=5). Each farm had 4 blocks (bk=4) including 2 trees as subsamples (tree=2) in which I assessed 100 flowers each one. This is a quick look of the data: farm trt bk tree dis tot <fctr> <fctr> <fctr> <fctr> <int> <int> iaras cal 1 1 0 100 iaras cal 1 2 1 100 iaras cal 2 1 1 100 iaras cal 2 2 3 100 iaras cal 3 1 0 100 iaras cal 3 2 5 100... The model I considered was: resp <- with(df, cbind(dis, tot-dis)) m1 = glmer(resp ~ trt + (1|farm/bk) , family = binomial, data=df) I tested the overdispersion with the overdisp_fun() from GLMM page <http://glmm.wikidot.com/faq> chisq ratio p logp 4.191645e+02 3.742540e+00 4.804126e-37 -8.362617e+01 As ratio (residual dev/residual df) > 1, and the p-value < 0.05, I considered to add the observation level random effect (link <http://r.789695.n4.nabble.com/Question-on-overdispersion-td3049898.html>) to deal with the overdispersion. farm trt bk tree dis tot tree_id <fctr> <fctr> <fctr> <fctr> <int> <int> <fctr> iaras cal 1 1 0 100 1 iaras cal 1 2 1 100 2 iaras cal 2 1 1 100 3... so now was added a random effect for each row (tree_id) to the model, but I am not sure of how to include it. This is my approach: m2 = glmer(resp ~ trt + (1|farm/bk) + (1|tree_id), family = binomial, data=df) I also wonder if farm should be a fixed effect, since it has only 3 levels... m3 = glmer(resp ~ trt * farm + (1|farm:bk) + (1|tree_id), family binomial, data=df) I really appreciate your suggestions about my model specifications... *Juan? Edwards- - - - - - - - - - - - - - - - - - - - - - - -# PhD student - ESALQ-USP/Brazil?* [[alternative HTML version deleted]]
Thierry Onkelinx
2017-Apr-24 07:12 UTC
[R] GLMM for Combined experiments and overdispersed data
Please don't cross post. You've send the message to the mixed models mailing list as well (which more appropriate). ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium 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 2017-04-21 20:57 GMT+02:00 Juan Pablo Edwards Molina < edwardsmolina at gmail.com>:> I am analyzing data from 3 field experiments (farms=3) for a citrus flower > disease: response variable is binomial because the flower can only be > diseased or healthy. > > I have particular interest in comparing 5 fungicide spraying systems > (trt=5). > > Each farm had 4 blocks (bk=4) including 2 trees as subsamples (tree=2) in > which I assessed 100 flowers each one. This is a quick look of the data: > > farm trt bk tree dis tot <fctr> <fctr> <fctr> > <fctr> <int> <int> > iaras cal 1 1 0 100 > iaras cal 1 2 1 100 > iaras cal 2 1 1 100 > iaras cal 2 2 3 100 > iaras cal 3 1 0 100 > iaras cal 3 2 5 100... > > The model I considered was: > > resp <- with(df, cbind(dis, tot-dis)) > > m1 = glmer(resp ~ trt + (1|farm/bk) , family = binomial, data=df) > > I tested the overdispersion with the overdisp_fun() from GLMM page > <http://glmm.wikidot.com/faq> > > chisq ratio p logp > 4.191645e+02 3.742540e+00 4.804126e-37 -8.362617e+01 > > As ratio (residual dev/residual df) > 1, and the p-value < 0.05, I > considered to add the observation level random effect (link > <http://r.789695.n4.nabble.com/Question-on-overdispersion-td3049898.html>) > to deal with the overdispersion. > > farm trt bk tree dis tot tree_id <fctr> <fctr> > <fctr> <fctr> <int> <int> <fctr> > iaras cal 1 1 0 100 1 > iaras cal 1 2 1 100 2 > iaras cal 2 1 1 100 3... > > so now was added a random effect for each row (tree_id) to the model, but I > am not sure of how to include it. This is my approach: > > m2 = glmer(resp ~ trt + (1|farm/bk) + (1|tree_id), family = binomial, > data=df) > > I also wonder if farm should be a fixed effect, since it has only 3 > levels... > > m3 = glmer(resp ~ trt * farm + (1|farm:bk) + (1|tree_id), family > binomial, data=df) > > I really appreciate your suggestions about my model specifications... > > > > > *Juan? Edwards- - - - - - - - - - - - - - - - - - - - - - - -# PhD student > - ESALQ-USP/Brazil?* > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/ > posting-guide.html > and provide commented, minimal, self-contained, reproducible code.[[alternative HTML version deleted]]