
   Hello, Murray:

   I am doing the modifications you suggested yesterday, starting with the (instotal
+
 weatherpc1|site) term. I was wondering if everytime I want to write an 
interaction between instotal or weatherpc1 and any other variable, I 
have to include the "|site" term. I mean, for example 
(instotal|site):tlength. If I do that, I've seen that the software does 
not interpret "instotal" and "weatherpc1" as fixed but random effects, 
and that's wrong. Even when I fit a model without removing any 
interaction, this way:



   fledgecoltailmodel1<-lmer(nfledge~sex*briventral*(instotal + weatherpc1|site)*tlength+(site|pair),family=poisson)



   I get this:



   > summary(fledgecoltailmodel1)

Generalized linear mixed model fit by the Laplace approximation 

Formula: nfledge ~ sex * briventral * (instotal + weatherpc1 | site) *      tlength + (site | pair) 

   AIC   BIC logLik deviance

 87.91 119.7 -26.96    53.91

Random effects:

 Groups Name        Variance   Std.Dev. Corr        

 site   (Intercept) 0.55555555 0.745356             

        instotal    0.00016816 0.012968 0.000       

        weatherpc1  0.33505869 0.578843 0.000 0.000 

 pair   (Intercept) 0.33333333 0.577350             

        site        0.00524246 0.072405 0.000       

Number of obs: 48, groups: site, 10; pair, 6



Fixed effects:

                          Estimate Std. Error z value Pr(>|z|)

(Intercept)             -9.088e-01  7.907e+00  -0.115    0.908

sexM                     3.312e-02  1.260e+01   0.003    0.998

briventral               1.653e-02  7.631e-02   0.217    0.828

tlength                  2.726e-02  8.832e-02   0.309    0.758

sexM:briventral          1.400e-02  1.328e-01   0.105    0.916

sexM:tlength            -5.034e-03  1.296e-01  -0.039    0.969

briventral:tlength      -1.990e-04  8.690e-04  -0.229    0.819

sexM:briventral:tlength -9.434e-05  1.359e-03  -0.069    0.945



Correlation of Fixed Effects:

            (Intr) sexM   brvntr tlngth sxM:br sxM:tl brvnt:

sexM        -0.670                                          

briventral  -0.965  0.662                                   

tlength     -0.995  0.675  0.973                            

sxM:brvntrl  0.574 -0.974 -0.610 -0.585                     

sexM:tlngth  0.715 -0.997 -0.710 -0.723  0.967              

brvntrl:tln  0.955 -0.661 -0.997 -0.968  0.615  0.711       

sxM:brvntr: -0.623  0.973  0.665  0.636 -0.996 -0.973 -0.672







   I mean, "instotal" and "weatherpc1" are not included in the fixed effect interactions. 

   Is that correct? 



   Thank you very much.



   Iker





--- El dom, 16/1/11, Murray Jorgensen <maj@waikato.ac.nz> escribió:

De: Murray Jorgensen <maj@waikato.ac.nz>
Asunto: Re: [R-sig-ME] Alternatives to lmer
Para: "Iker Vaquero Alba" <karraspito@yahoo.es>
CC: r-sig-mixed-models@r-project.org
Fecha: domingo, 16 de enero, 2011 23:34

On 17/01/2011 11:22 a.m., Iker Vaquero Alba wrote:
>
>
> Let me check that I am interpreting your data correctly. It seems that
> you have 12 sites at each of which
 you have a number of mated pairs. You
> have physical measurements on the male and the female of each pair and
> some environmental measurements on the sites.
>
> Yes, that's absolutely correct.
>
> The pairs are numbered within sites but some numbers are missing. Might
> they be the numbers corresponding to pairs that failed to fledge? I
> think maybe they should be there as well with nfledge = 0.
>
> Actually, the missing numbers correspond to the rows I have removed from
> the original data set because they contained "nfledge" missing values.
>
> 'instotal' and 'weatherpc1' are measured at the 'site' level, so the
> natural way to incorporate them in a model would be through a
>
> (instotal + weatherpc1|site)
>
> term.
>
> Would it be (instotal+weatherpc1|site) or
> (instotal|site+weatherpc1|site)? According to the way you've
 written it,
> only "weatherpc1" seems to be in relation to "site".

In a model formula term   ( .... |site) everything in the .... part is 
at the site level.


>
> Surely also 'nfledge' should be at the 'pair' level ?
>
> I think it would then be better to re-shape the data so that each row is
> a pair and, for example, 'tlength' splits into two covariates 'tlengthM'
> and 'tlengthF'.
>
> I see the point, but what would be the difference compared to having one
> individual per row and sex as a factor, as it is now?

Well 'nfledge' depends only on the pair. The units at which the response 
variable is measured must be the underlying units of the analysis.


>
> It looks doubtful to me that a Poisson model will fit this data well,
> with or without the addition of the nfledge = 0 pairs.
>
> Yes, the problem clearly seems
 to be in teh fact that it's a Poisson
> model, as assuming Gaussian errors it doesn't return any error message.

But that does not mean that the analysis is correct, even in an 
approximate way. I do not think your model formula reflects the 
structure of the data, even if it runs without computing errors.

Murray

>
> I think that you should be talking more to some local statisticians
> before you attempt to fit models to this data.
>
>
> Regards, Murray
>
> Thank you so, so much for all your suggestions. I will work on it and
> tell you if it worked.
>
> Best wishes, Iker
>
> On 17/01/2011 9:15 a.m., Iker Vaquero Alba wrote:
>  >
>  > Hello:
>  >
>  > As I posted several days ago, I was trying to implement this model:
>  >
>  >
>

 
fledgecoltailmodel1<-lmer(nfledge~sex*briventral*inslarge*weatherpc1*tlength-sex:briventral:inslarge:weatherpc1:tlength-sex:briventral:inslarge:weatherpc1-sex:briventral:inslarge:tlength-sex:briventral:weatherpc1:tlength-sex:inslarge:weatherpc1:tlength-briventral:inslarge:weatherpc1:tlength-sex:briventral:inslarge-sex:briventral:weatherpc1-sex:briventral:tlength-sex:inslarge:weatherpc1-sex:inslarge:tlength-sex:weatherpc1:tlength-briventral:inslarge:weatherpc1-briventral:inslarge:tlength-briventral:weatherpc1:tlength-inslarge:weatherpc1:tlength+(site|pair),family=poisson)
>  >
>  > but I got the error message:
>  >
>  > Error in asMethod(object) : matrix is not symmetric [1,2]
>  >
>  > as no one seems to know what could be the reason for that or how to
> find a solution, I was thinking that maybe I could try using another
> function. Starting with the one
 which seems more similar to "lmer", I
> tried with "GLMM", which I read in some post it could be taken from
> "lme4" package. However, when I try to use it (either "glmm" or "GLMM"),
> R tells me such function doesn't exist.
>  >
>  > Do you know why this could be happening? Do you know of any other
> functions I could use to fit my model? I was thinking as well of
> "MCMCglmm", but I'm not sure I can apply it to my model and I don't
> think I'm expert enough as to deal with its syntax or the overdispersion
> problems.
>  >
>  > I am using R 2.12.0
>  >
>  > Thank you very much for your help!
>  >
>  >
>  >
>  > Iker Vaquero-Alba
>  >
>  > Centre for Ecology
>  > and Conservation
>  >
>  > Daphne du
 Maurier
>  > Building
>  >
>  > University of Exeter,
>  > Cornwall Campus
>  >
>  > Treliever Road
>  >
>  > TR10 9EZ Penryn
>  >
>  > U.K.
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>  > [[alternative HTML version deleted]]
>  >
>  >
>  >
>  >
>  > _______________________________________________
>  > R-sig-mixed-models@r-project.org
> <compose?to=R-sig-mixed-models@r-project.org> mailing
 list
>  > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>
> --
> Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html
> Department of Statistics, University of Waikato, Hamilton, New Zealand
> Email: maj@waikato.ac.nz <compose?to=maj@waikato.ac.nz>
> majorgensen@ihug.co.nz <compose?to=majorgensen@ihug.co.nz> Fax 7 838 4155
> Phone +64 7 838 4773 wk Home
 +64 7 825 0441 Mobile 021 0200 8
>
>


-- 
Dr Murray Jorgensen      http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj@waikato.ac.nz    majorgensen@ihug.co.nz      Fax 7 838 4155
Phone  +64 7 838 4773 wk    Home +64 7 825 0441   Mobile 021 0200 8350



      
	[[alternative HTML version deleted]]


