[R] lmer or glm with family=binomial : probability variable
Francesca
cagnacci at cealp.it
Wed Jan 17 10:58:28 CET 2007
Dear all,
We are dealing with a variable (BA) which indicates the overlap between
small mammal home ranges. It varies between 0 and 1 and it can be
interpreted as "the probability of two home ranges to overlap",
therefore we would have modelled it with the binomial family, also
supported by the distribution of the variable itself. However, lmer or
glm require the data to be presented as successes vs failures. In our
case, this is not possible as BA is calculated by GIS on raster maps; in
other words, BA expressess p (probability of success), but it is not
possible to know from how many cases/attempts p came from.
Therefore, what we get from the analysis is:
IDAN_IDAN SESSO SESSIONE BA
1 1D00AD9_1D1421F F_F 1 5.909904e-06
2 1D00AD9_602F513 M_F 1 5.640469e-03
3 1D00AD9_602FEAB M_F 1 3.715911e-13
4 1D00AD9_603086B F_F 1 2.350365e-17
5 1D00AD9_60778A4 M_F 1 1.589195e-08
6 1D00AD9_60779D7 F_F 1 7.343189e-22
7 1D00AD9_6723D30 M_F 1 8.725496e-01
8 1D1421F_602F513 M_F 1 6.757339e-02
9 1D1421F_602FEAB M_F 1 7.612337e-01
10 1D1421F_603086B F_F 1 4.623883e-06
11 1D1421F_60778A4 M_F 1 2.856006e-01
12 1D1421F_60779D7 F_F 1 9.752100e-11
13 1D1421F_6723D30 M_F 1 8.921498e-08
14 602F513_602FEAB M_M 1 2.127866e-02
15 602F513_603086B M_F 1 6.695516e-05
16 1D00AD9_671ED61 M_F 2 3.873126e-01
17 1D00AD9_6723D30 M_F 2 2.080799e-01
18 1D00AD9_672594F M_F 2 3.983634e-15
19 1D1421F_602FEAB M_F 2 2.956002e-01
20 1D1421F_603086B F_F 2 2.150006e-06
21 1D1421F_60314C4 F_F 2 1.947681e-21
22 1D1421F_6033E53 M_F 2 1.855792e-01
23 1D1421F_60655F4 F_F 2 1.242808e-02
24 1D1421F_60778A4 M_F 2 1.398984e-02
> SESSIONE1<-factor(SESSIONE)
> model<-lmer(BA~ SESSO + (1|SESSIONE1:IDAN_IDAN) + (1|SESSIONE1),
data=foglio1, family=binomial)
Warning messages:
1: #non integer successes in glm binomial model! in: eval(expr, envir,
enclos)
2: nlminb returned message singular convergence (7)
in: LMEopt(x = mer, value = cv)
3: nlminb returned message false convergence (8)
in: LMEopt(x = mer, value = cv)
4: nlminb returned message singular convergence (7)
in: LMEopt(x = mer, value = cv)
5: nlminb returned message false convergence (8)
in: LMEopt(x = mer, value = cv)
6: nlminb returned message false convergence (8)
in: LMEopt(x = mer, value = cv)
7: IRLS iterations for PQL did not converge
Is there any possibility to model p vs q=1-p without passing by
successes vs failures frequencies?
Thank you very much for helping!!!
Best regards
Francesca Cagnacci
Francesca Cagnacci, PhD
****************************************
Centro di Ecologia Alpina
Viote del Monte Bondone
38040 Trento
Tel. +393388668767 or +393397481073
Email cagnacci at cealp.it or frcagnac at tin.it
More information about the R-help
mailing list