[R-sig-ME] help

Ben Bolker bbolker at gmail.com
Thu Jan 9 01:08:59 CET 2014


   [With apologies, I am re-forwarding this to r-sig-mixed-models: I
prefer to keep discussions there so they can be publicly viewed/archived.]

On 14-01-08 11:34 AM, jersa at centrum.cz wrote:
> Dear Ben, thank you so much for your help. It is rather hard for me
> to imagine all the statistical consequencies when building this
> model. Basically I do not see any clear pattern in the data, it seems
> that mother vicinity has no effect on germination and germination is
> quite random. I only see that the second year yielded most
> germinations, which is also confirmed in the tests. 

 OK

> The set up of
> directions was in all plants same (N, SE and SW).

   So there would be at least some possibility of consistent effects of
direction across plants (as well as random variations in those effects
across plants)

> 
> I tried to fit both variants you suggested (see bellow). And the
> results are nearly identical. May I aks one more question about
> plotting the probability to germinate with distance? Which function
> would you recommend for this?


  It's probably best to construct a new data frame that has the desired
distance vector in it, e.g.

   newdat <- data.frame(distance=seq(100))

then use predict() to get the probability

  newdat$germ_prob <- predict(model,newdata=newdat,type="response")

> 
> Thank you very much and have a nice day Jana
> 
>> prot1<-glmer(germination~distance+year+(1|plant/direction),family=binomial,data=prot)
>>
>> 
> summary(prot1)
> Random effects: Groups     Name        Variance Std.Dev. 
> direction:plant (Intercept) 0.0544   0.2332 plant
> (Intercept) 1.4151   1.1896 Number of obs: 252, groups:
> direction:plant, 21; plant, 7

I thought you said you had 10 plants, and I would have inferred 360
observations from your experimental design -- actually only 7 / 252?
> 
> Fixed effects: Estimate Std. Error z value Pr(>|z|) 

(Intercept) -1.840153   0.617722  -2.979  0.00289 **
vzd         -0.004394   0.005174  -0.849  0.39572
year2009     0.995211   0.434851   2.289  0.02210 *
year2011     0.588760   0.444732   1.324  0.18555

  Treating distance (I assume that's vzd?) as continuous is a good idea,
although you should take a look at the data to see that there isn't a
strong nonlinear trend.

> 
>> prot2<-glmer(germination~distance+year+(distance|plant),family=binomial,data=prot)
>>
>> 
summary(prot2)
> 
> Random effects: Groups Name        Variance  Std.Dev. Corr 
                   kytka (Intercept) 7.580e-01 0.870637
                         vzd         4.647e-05 0.006817 1.00
> Number of obs: 252, groups: kytka, 7

  Here 'kytka' is plant?   The distance effect and intercept are
perfectly correlated here, suggesting overfitting -- and the distance
variance is extremely small (ditto) -- yo
> 
> Fixed effects: Estimate Std. Error z value Pr(>|z|) 
(Intercept) -1.707002   0.527848  -3.234  0.00122 **
vzd         -0.007350   0.005982  -1.229  0.21916
year2009     0.993268   0.435158   2.283  0.02246 *
year2011     0.587586   0.444938   1.321  0.18663

  Notice the fixed-effect estimates here are nearly identical to the
previous case, because the estimates for the variances of the terms you
added to the model are nearly zero.



More information about the R-sig-mixed-models mailing list