I forgot to add this:

> with(SW_GVG,table(factor(GVG),Sward,Count>0))
, ,  = FALSE

   Sward
     0  1  2  3  4
  1  1 95 80 93 14
  2  0 26 40 32  1
  3  3  5  9  3  0
  4  0  3  0  2  0
  5  0  6 23 23  2
  6  0  2  2  1  0

, ,  = TRUE

   Sward
     0  1  2  3  4
  1  1 32  6  2  1
  2  0  0  0  1  0
  3  0  0  0  0  0
  4  0  0  0  0  0
  5  0  0  0  1  0
  6  0  0  0  0  0

Which, if i am not wrong, means that Ben is right when saying that all the combinations are not in my data set! 

Thanks again, 
Marta

From: lomasvega@hotmail.com
To: r-sig-mixed-models@r-project.org
CC: bbolker@gmail.com
Subject: RE: [R] errors with hurdle negative binomial mixed effect models
Date: Tue, 13 Aug 2013 15:38:16 +0200




Hello, 

Ben, thank you for your answers, they have been useful. However, I am still struggling to interpret the errors.. 

My mail was forwarded to this mailing list by Ben. He gave me some advices but I did not find out the solutions yet.

The conclusion that I have after looking into what means that "not all the interactions of the categorical variables have coverage" is that I cannot test those variables together in the specific models where the Rank error appears.

Is this correct?

thanks!
Marta


> Date: Fri, 9 Aug 2013 17:20:53 -0400
> From: bbolker@gmail.com
> To: r-sig-mixed-models@r-project.org
> CC: lomasvega@hotmail.com
> Subject: Fwd: RE: [R] errors with hurdle negative binomial mixed effect models
> 
> 
>   [forwarded to r-sig-mixed-models]
> 
> 
> -------- Original Message --------
> Subject: 	RE: [R] errors with hurdle negative binomial mixed effect models
> Date: 	Fri, 9 Aug 2013 19:39:33 +0200
> From: 	Marta Lomas <lomasvega@hotmail.com>
> To: 	Ben Bolker <bbolker@gmail.com>
> 
> > Thanks Ben! Just 2 questions before getting into the site you adviced me:
> 
> > So if some combinations of the variable categories are missing, meaning
> > that not all the combinations are present in the data set, will not be
> > possible to run these models?
> 
>    Please see the FAQ I sent you to for information about dealing with
> interactions of categorical variables with incomplete coverage.
> 
> > If understand, perfectly multicollinear variables means that they are
> > correlated. But the Pearson coefficients show that they are not.
> > Is it possible that it is because in many observations I have the same
> > category level for those variables? for example, GVG= 1 and sward = 1;
> 
>   It is possible for a set of more than two variables to be multicollinear
> (e.g. A+B+C=constant) even when no pair is perfectly correlated,
> although I don't know if that's the case here ...
> 
> Ah! the summary is:
> 
> 
> > summary(SW_GVG)
>    Year     Week    Count            Sward     GVG09          Cluster
>  2013:510   1:102   Min.   : 0.000  0:  5     20,525:325      Min.:1.000
>             2:102   1st Qu.: 0.000  1:169     28,125:100     1st Qu.:1.000
>             3:102   Median : 0.000  2:160   34,775: 20         Median:4.000
>             4:102   Mean   : 1.316  3:158   51,375: 5         Mean   :3.951
>             5:102   3rd Qu.: 0.000  4: 18    74,2  : 55       3rd Qu.:6.000
>                     Max.   :95.000           78    :5         Max.   :8.000
> 
>       GVG        SCluster
>  Min.   :1.000     1:135
>  1st Qu.:1.000    2: 85
>  Median :1.000   3: 25
>  Mean   :1.784    4: 35
>  3rd Qu.:2.000    6:125
>  Max.   :6.000    7: 95
>                   8: 10
> 
> 
>   I don't know exactly what's going on here, but you should look
> at
> 
> with(SW_GVG,table(factor(GVG),Sward,Count>0))
> 
> I suspect you will find there are empty cells.
> 
>   Ben Bolker
> 
> 
> > To: r-help@stat.math.ethz.ch
> > From: bbolker@gmail.com
> > Date: Fri, 9 Aug 2013 17:07:31 +0000
> > Subject: Re: [R] errors with hurdle negative binomial mixed effect models
> >
> > Marta Lomas <lomasvega <at> hotmail.com> writes:
> >
> > >
> > > Hello!
> >
> > > I am new in the mailing list for R help and I hope to be able to
> > > formulate a good question easy to understand.
> >
> > We hope so too :-)
> >
> > [snip]
> >
> > I will take a first crack at this here, but follow-ups should
> > probably be redirected to the r-sig-mixed-models@r-project.org
> > mailing list, which is more appropriate for questions dealing
> > with (G)LMMs.
> >
> > > I am modeling my data set with hurdle negative binomial mixed
> > > effects, to find the correlation of some bird counts with
> > > environmental (categorical and continuous) variables.
> >
> > > When I run different models I have always an error. For instance:
> > >
> > > -For the truncated modeling of the non-zero counts:
> > >
> > > > HURgvgsw <- glmmadmb(count~ GVG*sward + (1|week),
> > > data=subset(SW_GVG,count>0), + family=
> > > "truncnbinom")
> > >
> > > Error en glmmadmb(count ~ GVG * sward + (1 | week), data =
> subset(SW_GVG, :
> > > rank of X = 6 < ncol(X) = 10
> > >
> > > -Or the binomial part where the zeros are modeled with the non-zeros:
> > >
> > > > HURgvgsw <- glmmadmb(count~ sward*GVG + (1|week) + (1|cluster),
> > > data=SW_GVG, family= "binomial")
> > >
> > > Error en glmmadmb(count ~ sward * GVG + (1 | week) +
> > > (1 | cluster), data = SW_GVG, :
> > > rank of X = 13 < ncol(X) = 15
> > >
> > > Would you have the solution to this?
> >
> > This error message is telling you that some of your fixed-effect
> > variables (which are, internally, combined into the fixed-effect
> > design matrix X) are perfectly multicollinear. This is most likely
> > happening because sward and GVG are categorical variables (or at
> > least are being treated as categorical variables) and some
> > combinations are missing from the data set (for future reference:
> > the output of summary(SW_GVG) is useful for diagnosis).
> >
> > For more information, search http://glmm.wikidot.com/faq for the
> > word 'rank'
> >
> > Good luck
> > Ben Bolker
> >
> > ______________________________________________
> > R-help@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.
> 
> 
 		 	   		   		 	   		  
	[[alternative HTML version deleted]]

