[R] glmer with non integer weights

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Tue Apr 13 10:24:30 CEST 2010


Dear Kay,

There is a R list about mixed models. Which is a better place for your
questions.

The (quasi)binomial family is used with binary data or a ratio that
originates from binary data. In case of a ratio you need to provide the
number of trials through the weights argument.

Further I would suggest to drop stage from either the random effects or
the fixed effects. You are trying to estimate the same effect twice in a
model.

HTH,

Thierry

------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium

Research Institute for Nature and Forest
team Biometrics & Quality Assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium

tel. + 32 54/436 185
Thierry.Onkelinx op inbo.be
www.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
  

> -----Oorspronkelijk bericht-----
> Van: r-help-bounces op r-project.org 
> [mailto:r-help-bounces op r-project.org] Namens Kay Cichini
> Verzonden: maandag 12 april 2010 16:12
> Aan: r-help op r-project.org
> Onderwerp: [R] glmer with non integer weights
> 
> 
> hello,
> 
> i'd appreciate help with my glmer.
> i have a dependent which is an index (MH.index) ranging from 
> 0-1. this index can also be considered as a propability. as i 
> have a fixed factor (stage) and a nested random factor (site) 
> i tried to model with glmer. i read that it's possible to use 
> a quasibinomial distribution, for this kind of data, which i 
> than actually did - but firstly 
> 
> (1) i'm not quite sure if that's appropiate for my data, secondly
> (2) i wondered if the model can be correct when variance of 
> then main and nested factor are zero.
> (3) also i could not yield p-values for that model.
> 
> here's data, call and output:
> 
> ##########################################################
> #call:
> ##########################################################
> 
> glmer(MH~stage+(1|stage/site),family=quasibinomial)
> 
> ##########################################################
> #output:
> ##########################################################
> #Generalized linear mixed model fit by the Laplace approximation
> #Formula: MH ~ stage + (1 | stage/site) 
> #  AIC   BIC logLik deviance
> # 66.03 86.47 -26.01    52.03
> #Random effects:
> # Groups     Name        Variance Std.Dev.
> # site:stage (Intercept) 0.000000 0.000   
> # stage      (Intercept) 0.000000 0.000   
> # Residual               0.076175 0.276   
> # Number of obs: 137, groups: site:stage, 39; stage, 4
> 
> #Fixed effects:
> #            Estimate Std. Error t value
> #(Intercept)  0.39205    0.09009   4.352
> #stageB      -0.87214    0.12498  -6.978
> #stageC      -0.36153    0.12202  -2.963
> #stageD      -0.09884    0.19811  -0.499
> 
> #Correlation of Fixed Effects:
> #       (Intr) stageB stageC
> #stageB -0.721              
> #stageC -0.738  0.532       
> #stageD -0.455  0.328  0.336
> ##########################################################
> #my data:
> ##########################################################
> similarity<-data.frame(list(structure(list(stage = 
> structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
> 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
> 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 
> 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
> 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
> 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 
> 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
> 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
> 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 
> 4L, 4L, 4L, 4L), .Label = c("A", "B", "C", "D"), class = 
> "factor"), site = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 
> 3L, 3L, 4L, 4L, 4L, 4L, 5L, 6L, 6L, 6L, 6L, 7L, 7L, 7L, 8L, 
> 8L, 8L, 8L, 9L, 9L, 9L, 9L, 10L, 10L, 10L, 10L, 11L, 11L, 
> 12L, 12L, 12L, 13L, 13L, 13L, 14L, 14L, 14L, 14L, 15L, 15L, 
> 15L, 15L, 16L, 16L, 16L, 17L, 17L, 17L, 17L, 18L, 18L, 19L, 
> 19L, 19L, 19L, 20L, 20L, 20L, 20L, 21L, 21L, 21L, 21L, 22L, 
> 22L, 22L, 22L, 23L, 23L, 23L, 24L, 24L, 24L, 24L, 25L, 25L, 
> 25L, 25L, 26L, 26L, 26L, 26L, 27L, 27L, 27L, 27L, 28L, 28L, 
> 28L, 28L, 29L, 29L, 29L, 30L, 30L, 30L, 30L, 31L, 31L, 32L, 
> 32L, 32L, 32L, 33L, 33L, 33L, 33L, 34L, 34L, 34L, 34L, 35L, 
> 35L, 35L, 35L, 36L, 36L, 36L, 36L, 37L, 37L, 38L, 38L, 38L, 
> 38L, 39L, 39L, 39L ), .Label = c("A11", "A12", "A14", "A15", 
> "A16", "A17", "A18", "A19", "A20", "A5", "A7", "A8", "B1", 
> "B12", "B13", "B14", "B15", "B17", "B18", "B2", "B4", "B7", 
> "B8", "B9", "C1", "C10", "C11", "C15", "C17", "C18", "C19", 
> "C2", "C20", "C3", "C4", "C6", "D1", "D4", "D7"), class = 
> "factor"), MH.Index = c(0.392156863, 0.602434077, 
> 0.576923077, 0.647482014, 0.989010989, 0.857142857, 1, 1, 1, 
> 0, 1, 0.378378378, 0.839087948, 0.252915554, 1, 0.22556391, 
> 0.510366826, 0.476190476, 0.555819477, 0.961538462, 
> 0.666666667, 0.089285714, 0.923076923, 0.571428571, 0, 
> 0.923076923, 0.617647059, 0.599423631, 0, 0.727272727, 
> 0.998112812, 0, 0, 0, 1, 0.565656566, 0.75, 0.923076923, 
> 0.654545455, 0.14084507, 0.617647059, 0.315789474, 
> 0.179347826, 0.583468021, 0.165525114, 0.817438692, 
> 0.455551457, 0.49548886, 0.556127703, 0.707431246, 
> 0.506757551, 0.689655172, 0.241433511, 0.379232506, 
> 0.241935484, 0, 0.30848329, 0.530973451, 0.148148148, 0, 
> 0.976744186, 0.550218341, 0.542168675, 0.769230769, 
> 0.153310105, 0, 0, 0.380569406, 0.742174733, 0.222222222,
> 0.046925432, 0, 0.068076328, 0.772727273, 0.830039526, 
> 0.503458415, 0.863910822, 0.39401263, 0.081818182, 
> 0.368421053, 0.088607595, 0, 0.575499851, 0.605657238, 
> 0.714854232, 0.855881172, 0.815689401, 0.552207228, 
> 0.81708081, 0.583228133, 0.334466349, 0.259477365, 
> 0.194711538, 0.278916707, 0.636304805, 0.593715432, 
> 0.661016949, 0.626865672, 0.420219245, 0.453535143, 
> 0.471243706, 0.462427746, 0.56980057, 0.453821155, 
> 0.052828527, 0.926829268, 0.51988266, 0.472200264, 
> 0.351219512, 0.290030211, 0.765258974, 0.564894108, 
> 0.789699571, 0.863378215, 0.525181559, 0.803061458, 
> 0.260164645, 0.477265792, 0.265889379, 0.317791411, 
> 0.107623318, 0.279181709, 0.471953363, 0.463724265, 
> 0.241966696, 0.403647213, 0.693087992, 0.494259925, 
> 0.68904453, 0.39329147, 0.498161213, 0.376225983, 
> 0.407001046, 0.825016633, 0.718991658, 0.662995912)), .Names
> = c("stage", "site", "MH.Index"), class = "data.frame", 
> row.names = c(NA,
> -136L))))
> ##########################################################
> --
> View this message in context: 
> http://n4.nabble.com/glmer-with-non-integer-weights-tp1837179p
> 1837179.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help op r-project.org mailing list
> 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.
> 

Druk dit bericht a.u.b. niet onnodig af.
Please do not print this message unnecessarily.

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-help mailing list