Thanks Andy.

Here is the code I run:
*glmer(DV ~ F1 + F2 + F3 + F4 + F5 + (1|R1), data, family=binomial)*
**
and here are my first 25 cases


DV   R1   F1         F2   F3        F4   F5

1       10    0.058   0     0.000   0      0

1       13    0.011   0     0.000   0      1

0       13    0.012   1     0.000   0      1

1       11    0.176   1     0.074   0      1

1       3      0.116   0     0.035   0      1

0       3      0.116   0     0.035   0      1

1       5      0.012   0     0.000   0      1

1       6      0.037   0     0.048   0      1

0       12    0.003   0     0.000   0      1

0       12    0.020   0     0.000   0      1

0       3      0.043   0     0.017   0      1

0       12    0.029   0     0.000   0      1

0       12    0.003   0     0.000   0      1

0       8      0.023   0     0.000   0      1

0       13    0.020   0     0.000   0      1

0       6      0.037   0     0.048   0      1

0       13    0.011   0     0.000   0      1

1       12    0.089   0     0.000   0      1

0       13    0.012   1     0.000   0      1

0       11    0.029   1     0.000   0      1

0       4      0.020   1     0.014   0      1

1       13    0.020   0     0.000   0      1

1       13    0.020   0     0.000   0      1

0       12    0.000   1     0.000   1      1

1       9      0.043   0     0.000   1      1

On Wed, May 20, 2009 at 1:37 PM, Andrew Dolman <andydolman@gmail.com> wrote:

> Whatever your groups are (your R1), there's no difference between them, or
> at least so little that the variance is estimated as 0.
>
>
> #Run this little example a few times with different random data.
>
> library(lme4)
>
> res <- rbinom(1000,1, 0.2)
> G1 <- rep(1:10, 100)
> F1 <- c(rep(1,500),rep(2,500))
> F2 <- rnorm(1000)
>
> dat <- data.frame(res,F1,G1,F2)
>
> lmer1 <- glmer(res~F1+F2+(1|G1), data=dat, family=binomial)
> summary(lmer1)
>
> xyplot(res~F2|G1, data=dat)
>
>
>
> The variance for group G1 is sometimes 0, sometimes just very small (e.g.
> 1.8419e-12).
>
>
> Andy.
>
> If you include examples of your data and the actual code you try to run you
> will get better answers from the list.
>
> See posting guide.
>
>
>
> andydolman@gmail.com
>
>
> 2009/5/20 João R. <joaordaniel@gmail.com>
>
>  Thanks Ken, but I did not fully understood you.
>>
>> *This means that the variance of the random effect needed to explain your
>> data is zero.*
>> This part I get, although the fact that the value for variance is an
>> absolute 0 makes me wonder if there is something wrong. I would be happy
>> with a low value, but not exactly 0.
>> The fact that two of the fixed factors are continuous variables might have
>> something to do with it?
>> *The clusters vary by the same amount or less than if there was a random
>> effect, that is they can all be explained by subject variation.*
>> This part I don't follow...
>>
>> Basically, I am trying to predict the occurrence of reconciliation after
>> conflicts in a primate group (dependent variable: 0-no occurrence;
>> 1-reconciliation). My random variable is the victim's identity of these
>> conflicts (since not all group members are victims of conflicts, and some
>> are "more victims" than others). As fixed effects I have a set of
>> variables
>> (describing the type of conflict and the relationship between opponents;
>> 23
>> variables), some continuous (ex. F1, F3) and other categorical (ex. F2, F4
>> e
>> F5). Using a forward selection procedure based on AIC values, the best fit
>> model is this one I presented with the five fixed factors.
>>
>> Thanks again.
>>
>>
>>
>>
>> On Wed, May 20, 2009 at 10:09 AM, Ken Beath <ken@kjbeath.com.au> wrote:
>>
>> > On 20/05/2009, at 11:43 AM, João R. wrote:
>> >
>> > Hello,
>> >> I have recently used lme4 package to run a glmm, but a get 0 variance
>> >> explained by the random effect. The model has 5 fixed effects, and I
>> have
>> >> run each of them separately and for two of them (F1, F3) I also get 0
>> >> variance for the random effect. Do you have any ideas of what might be
>> >> causing this? Is this kind of result to be expected?
>> >> thanks
>> >>
>> >>
>> > This means that the variance of the random effect needed to explain your
>> > data is zero.  The clusters vary by the same amount or less than if
>> there
>> > was a random effect, that is they can all be explained by subject
>> variation.
>> >
>> > Ken
>> >
>> >
>> >
>> >> Generalized linear mixed model fit by the Laplace approximation
>> >> Formula: DV ~ F1 + F2 + F3 + F4 + F5 + (1 | R1)
>> >>  Data: JD
>> >>  AIC   BIC logLik deviance
>> >> 203.2 225.9  -94.6    189.2
>> >> Random effects:
>> >> Groups Name        Variance Std.Dev.
>> >> R1  (Intercept)  0        0
>> >> Number of obs: 190, groups: R1, 14
>> >> Fixed effects:
>> >>           Estimate Std. Error z value Pr(>|z|)
>> >> (Intercept)   1.8949     1.1869   1.596  0.11039
>> >> F1          4.6740     2.4365   1.918  0.05507 .
>> >> F2         -2.0657     0.7543  -2.739  0.00617 **
>> >> F3       21.8036     8.8890   2.453  0.01417 *
>> >> F4   1.0968     0.4874   2.250  0.02444 *
>> >> F5      -1.7430     0.9583  -1.819  0.06894 .
>> >>
>> >>        [[alternative HTML version deleted]]
>> >>
>> >> _______________________________________________
>> >> R-sig-mixed-models@r-project.org mailing list
>> >> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>> >>
>> >>
>> >
>>
>>        [[alternative HTML version deleted]]
>>
>>
>> _______________________________________________
>> R-sig-mixed-models@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>
>>
>

	[[alternative HTML version deleted]]


