Discussion:
[R-sig-ME] Model average error message
Helen McCallin
2018-07-23 09:33:03 UTC
Permalink
Hi


I am running a glmer model on a response variable with binomial distribution and random term. My data has 3 explanatory categorical variables and I have successfully run dredge() on them and their interactions to get AICc values.


I want model averaging to provide output with coefficients and an index of relative importance of fixed effects from those models; within a delta constraint that I specify.I can get this using the code below for alternative datasets but not for this dataset.


model.avg() produces this error message:

Error in model.avg.default(get.models(models, subset = delta < 5)) : models are not unique. Duplicates: '2 = 3 = 4' and '10 = 11'


This doesn't make sense, DREDGE does not (cannot) produce duplicate models – each model is a unique iteration within the full model, yet the error message indicates that MODEL AVERAGE identified ‘duplicate’ models from within DREDGE output. R fails to run MODEL AVERAGE under these circumstances - producing no further output.


Has anyone else experienced similar problem (with 'not unique', duplicate models) via MODEL AVERAGE?


Is there a workaround for the error that prevents me running MODEL AVERAGE due to perceived ‘duplicate’ models in DREDGE?


Many thanks for any help anyone can provide.



[[alternative HTML version deleted]]
Phillip Alday
2018-07-25 12:50:34 UTC
Permalink
Hi Helen,

model.avg() tells you which models are duplicates. What do the formulas
look like for those models? Seeing the formulae may help identify what
model.avg() gets stuck on.

Best,
Phillip

On 07/23/2018 11:33 AM, Helen McCallin wrote:
> Hi
>
>
> I am running a glmer model on a response variable with binomial distribution and random term. My data has 3 explanatory categorical variables and I have successfully run dredge() on them and their interactions to get AICc values.
>
>
> I want model averaging to provide output with coefficients and an index of relative importance of fixed effects from those models; within a delta constraint that I specify.I can get this using the code below for alternative datasets but not for this dataset.
>
>
> model.avg() produces this error message:
>
> Error in model.avg.default(get.models(models, subset = delta < 5)) : models are not unique. Duplicates: '2 = 3 = 4' and '10 = 11'
>
>
> This doesn't make sense, DREDGE does not (cannot) produce duplicate models – each model is a unique iteration within the full model, yet the error message indicates that MODEL AVERAGE identified ‘duplicate’ models from within DREDGE output. R fails to run MODEL AVERAGE under these circumstances - producing no further output.
>
>
> Has anyone else experienced similar problem (with 'not unique', duplicate models) via MODEL AVERAGE?
>
>
> Is there a workaround for the error that prevents me running MODEL AVERAGE due to perceived ‘duplicate’ models in DREDGE?
>
>
> Many thanks for any help anyone can provide.
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-***@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
Phillip Alday
2018-07-25 15:09:17 UTC
Permalink
(Please keep the list in CC.)

The output of

get.models(models,subset=delta<5)

would be more interesting. Or even better:

lapply(get.models(models,subset=delta<5), formula)

So that we see which formulas are being labelled as identical.

Phillip

On 07/25/2018 04:56 PM, Helen McCallin wrote:
> Hi Phil
>
> Thank you so much for your reply. Please find the codes I am using
> below. Is this what you mean?
>
> ae <- read.csv(file=file.choose())
>
> options(na.action="na.fail")
>
> global.model<-glmer(
>
>
> cbind(numerator,total-numerator)~d+s+t+p+d:s:t:p+d:s:t+d:s:p+d:t:p+s:t:p+d:t+d:s+d:p+s:t+s:p+t:p+(1|random),
>
> data=ae, family=binomial)
>
> options(max.print=1000000)
>
> dredge(global.model,beta=c("none"),evaluate=TRUE,rank="AICc")
>
> ae.model <- glmer(
>
>
> cbind(numerator,total-numerator)~d+s+t+p+d:s:t:p+d:s:t+d:s:p+d:t:p+s:t:p+d:t+d:s+d:p+s:t+s:p+t:p+(1|random),
>
> data=ae,family=binomial)
>
> models <- dredge(ae.model)
>
> summary(model.avg(get.models(models,subset=delta<5)))
>
>
> Many thanks for any help.
>
> Best wishes
>
> Helen
>
> On 25 Jul 2018, at 13:50, Phillip Alday <***@mpi.nl
> <mailto:***@mpi.nl>> wrote:
>
>> Hi Helen,
>>
>> model.avg() tells you which models are duplicates. What do the formulas
>> look like for those models? Seeing the formulae may help identify what
>> model.avg() gets stuck on.
>>
>> Best,
>> Phillip
>>
>> On 07/23/2018 11:33 AM, Helen McCallin wrote:
>>> Hi
>>>
>>>
>>> I am running a glmer model on a response variable with binomial
>>> distribution and random term. My data has 3 explanatory categorical
>>> variables and I have successfully run dredge() on them and their
>>> interactions to get AICc values.
>>>
>>>
>>> I want model averaging to provide output with coefficients and an
>>> index of relative importance of fixed effects from those models;
>>> within a delta constraint that I specify.I can get this using the
>>> code below for alternative datasets but not for this dataset.
>>>
>>>
>>> model.avg() produces this error message:
>>>
>>> Error in model.avg.default(get.models(models, subset = delta < 5)) :
>>> models are not unique. Duplicates: '2 = 3 = 4' and '10 = 11'
>>>
>>>
>>> This doesn't make sense, DREDGE does not (cannot) produce duplicate
>>> models – each model is a unique iteration within the full model, yet
>>> the error message indicates that MODEL AVERAGE identified ‘duplicate’
>>> models from within DREDGE output. R fails to run MODEL AVERAGE under
>>> these circumstances - producing no further output.
>>>
>>>
>>> Has anyone else experienced similar problem (with 'not unique',
>>> duplicate models) via MODEL AVERAGE?
>>>
>>>
>>> Is there a workaround for the error that prevents me running MODEL
>>> AVERAGE due to perceived ‘duplicate’ models in DREDGE?
>>>
>>>
>>> Many thanks for any help anyone can provide.
>>>
>>>
>>>
>>> [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-mixed-***@r-project.org
>>> <mailto:R-sig-mixed-***@r-project.org> mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>>
Helen McCallin
2018-07-25 15:17:18 UTC
Permalink
Apologies, very new to this! I am currently away from my computer but as soon as I am home (within the hour) I will get those for you.

Many thanks again

Helen

> On 25 Jul 2018, at 16:09, Phillip Alday <***@mpi.nl> wrote:
>
> (Please keep the list in CC.)
>
> The output of
>
> get.models(models,subset=delta<5)
>
> would be more interesting. Or even better:
>
> lapply(get.models(models,subset=delta<5), formula)
>
> So that we see which formulas are being labelled as identical.
>
> Phillip
>
>> On 07/25/2018 04:56 PM, Helen McCallin wrote:
>> Hi Phil
>>
>> Thank you so much for your reply. Please find the codes I am using
>> below. Is this what you mean?
>>
>> ae <- read.csv(file=file.choose())
>>
>> options(na.action="na.fail")
>>
>> global.model<-glmer(
>>
>>
>> cbind(numerator,total-numerator)~d+s+t+p+d:s:t:p+d:s:t+d:s:p+d:t:p+s:t:p+d:t+d:s+d:p+s:t+s:p+t:p+(1|random),
>>
>> data=ae, family=binomial)
>>
>> options(max.print=1000000)
>>
>> dredge(global.model,beta=c("none"),evaluate=TRUE,rank="AICc")
>>
>> ae.model <- glmer(
>>
>>
>> cbind(numerator,total-numerator)~d+s+t+p+d:s:t:p+d:s:t+d:s:p+d:t:p+s:t:p+d:t+d:s+d:p+s:t+s:p+t:p+(1|random),
>>
>> data=ae,family=binomial)
>>
>> models <- dredge(ae.model)
>>
>> summary(model.avg(get.models(models,subset=delta<5)))
>>
>>
>> Many thanks for any help.
>>
>> Best wishes
>>
>> Helen
>>
>> On 25 Jul 2018, at 13:50, Phillip Alday <***@mpi.nl
>> <mailto:***@mpi.nl>> wrote:
>>
>>> Hi Helen,
>>>
>>> model.avg() tells you which models are duplicates. What do the formulas
>>> look like for those models? Seeing the formulae may help identify what
>>> model.avg() gets stuck on.
>>>
>>> Best,
>>> Phillip
>>>
>>>> On 07/23/2018 11:33 AM, Helen McCallin wrote:
>>>> Hi
>>>>
>>>>
>>>> I am running a glmer model on a response variable with binomial
>>>> distribution and random term. My data has 3 explanatory categorical
>>>> variables and I have successfully run dredge() on them and their
>>>> interactions to get AICc values.
>>>>
>>>>
>>>> I want model averaging to provide output with coefficients and an
>>>> index of relative importance of fixed effects from those models;
>>>> within a delta constraint that I specify.I can get this using the
>>>> code below for alternative datasets but not for this dataset.
>>>>
>>>>
>>>> model.avg() produces this error message:
>>>>
>>>> Error in model.avg.default(get.models(models, subset = delta < 5)) :
>>>> models are not unique. Duplicates: '2 = 3 = 4' and '10 = 11'
>>>>
>>>>
>>>> This doesn't make sense, DREDGE does not (cannot) produce duplicate
>>>> models – each model is a unique iteration within the full model, yet
>>>> the error message indicates that MODEL AVERAGE identified ‘duplicate’
>>>> models from within DREDGE output. R fails to run MODEL AVERAGE under
>>>> these circumstances - producing no further output.
>>>>
>>>>
>>>> Has anyone else experienced similar problem (with 'not unique',
>>>> duplicate models) via MODEL AVERAGE?
>>>>
>>>>
>>>> Is there a workaround for the error that prevents me running MODEL
>>>> AVERAGE due to perceived ‘duplicate’ models in DREDGE?
>>>>
>>>>
>>>> Many thanks for any help anyone can provide.
>>>>
>>>>
>>>>
>>>> [[alternative HTML version deleted]]
>>>>
>>>> _______________________________________________
>>>> R-sig-mixed-***@r-project.org
>>>> <mailto:R-sig-mixed-***@r-project.org> mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>>>
Helen McCallin
2018-07-25 17:15:03 UTC
Permalink
Hi Phil

I have run the lapply code and this was the output


lapply(get.models(models,subset=delta<5),formula)

$`720`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:t + p:s + s:t



$`976`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:t + p:s + p:t + s:t



$`9168`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:t + p:s + p:t + s:t + p:s:t



$`9120`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + p:s + p:t + s:t + p:s:t



$`640`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + s:t



$`768`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + s:t



$`896`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:t + s:t



$`1024`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t



$`1792`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + s:t + d:p:s



$`2048`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:p:s



$`2944`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:t + s:t + d:p:t



$`3072`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:p:t



$`4096`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:p:s + d:p:t



$`4736`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + s:t + d:s:t



$`4864`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + s:t + d:s:t



$`4992`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:t + s:t + d:s:t



$`5120`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:s:t



$`5888`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + s:t + d:p:s + d:s:t



$`6144`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:p:s + d:s:t



$`7040`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:t + s:t + d:p:t + d:s:t



$`7168`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:p:t + d:s:t



$`8192`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:p:s + d:p:t + d:s:t



$`9216`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + p:s:t



$`10240`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:p:s + p:s:t



$`11264`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:p:t + p:s:t



$`12288`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:p:s + d:p:t + p:s:t



$`13312`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:s:t + p:s:t



$`14336`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:p:s + d:s:t + p:s:t



$`15360`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:p:t + d:s:t + p:s:t



$`16384`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:p:s + d:p:t + d:s:t + p:s:t



$`32768`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + s:t + d:p:s + d:p:t + d:s:t + p:s:t + d:p:s:t



$`960`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + p:s + p:t + s:t



$`1984`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + p:s + p:t + s:t + d:p:s



$`9152`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + p:s + p:t + s:t + p:s:t



$`10176`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + p:s + p:t + s:t + d:p:s + p:s:t



$`736`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:t + p:s + s:t



$`992`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:t + p:s + p:t + s:t



$`3040`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:t + p:s + p:t + s:t + d:p:t



$`9184`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:t + p:s + p:t + s:t + p:s:t



$`11232`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:t + p:s + p:t + s:t + d:p:t + p:s:t



$`624`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t + s:t



$`752`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t + p:s + s:t



$`880`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t + p:t + s:t



$`1008`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t + p:s + p:t + s:t



$`4720`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t + s:t + d:s:t



$`4848`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t + p:s + s:t + d:s:t



$`4976`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t + p:t + s:t + d:s:t



$`5104`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t + p:s + p:t + s:t + d:s:t



$`9200`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t + p:s + p:t + s:t + p:s:t



$`13296`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t + p:s + p:t + s:t + d:s:t + p:s:t



$`622`

cbind(numerator, total - numerator) ~ d + s + t + (1 | random) + d:s + d:t + s:t



$`4718`

cbind(numerator, total - numerator) ~ d + s + t + (1 | random) + d:s + d:t + s:t + d:s:t



$`590`

cbind(numerator, total - numerator) ~ d + s + t + (1 | random) + d:t + s:t



$`608`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:t + s:t



$`864`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:t + p:t + s:t



$`2912`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:t + p:t + s:t + d:p:t



$`592`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:t + s:t



$`848`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:t + p:t + s:t



$`704`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + p:s + s:t



$`1728`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + p:s + s:t + d:p:s



$`7`

cbind(numerator, total - numerator) ~ p + s + (1 | random)



$`76`

cbind(numerator, total - numerator) ~ d + p + t + (1 | random) + d:t



$`332`

cbind(numerator, total - numerator) ~ d + p + t + (1 | random) + d:t + p:t



$`92`

cbind(numerator, total - numerator) ~ d + p + t + (1 | random) + d:p + d:t



$`348`

cbind(numerator, total - numerator) ~ d + p + t + (1 | random) + d:p + d:t + p:t



$`2396`

cbind(numerator, total - numerator) ~ d + p + t + (1 | random) + d:p + d:t + p:t + d:p:t



$`5`

cbind(numerator, total - numerator) ~ s + (1 | random)



$`184`

cbind(numerator, total - numerator) ~ d + p + s + (1 | random) + d:p + d:s + p:s



$`1208`

cbind(numerator, total - numerator) ~ d + p + s + (1 | random) + d:p + d:s + p:s + d:p:s



$`928`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + p:s + p:t + s:t



$`135`

cbind(numerator, total - numerator) ~ p + s + (1 | random) + p:s



$`152`

cbind(numerator, total - numerator) ~ d + p + s + (1 | random) + d:p + p:s



$`112`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t



$`240`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t + p:s



$`368`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t + p:t



$`496`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:s + d:t + p:s + p:t



$`448`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + p:s + p:t



$`1472`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + p:s + p:t + d:p:s



$`128`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t



$`256`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s



$`384`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:t



$`512`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t



$`1280`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + d:p:s



$`1536`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + d:p:s



$`2432`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:t + d:p:t



$`2560`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + d:p:t



$`3584`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:s + d:t + p:s + p:t + d:p:s + d:p:t



$`78`

cbind(numerator, total - numerator) ~ d + s + t + (1 | random) + d:t



$`80`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:t



$`336`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:t + p:t



$`96`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:t



$`352`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:t + p:t



$`2400`

cbind(numerator, total - numerator) ~ d + p + s + t + (1 | random) + d:p + d:t + p:t + d:p:t


Does this help?

Many thanks

Helen


From: Helen McCallin<mailto:***@hotmail.com>
Sent: 25 July 2018 16:17
To: Phillip Alday<mailto:***@mpi.nl>
Cc: r-sig-mixed-***@r-project.org<mailto:r-sig-mixed-***@r-project.org>
Subject: Re: [R-sig-ME] Model average error message

Apologies, very new to this! I am currently away from my computer but as soon as I am home (within the hour) I will get those for you.

Many thanks again

Helen

> On 25 Jul 2018, at 16:09, Phillip Alday <***@mpi.nl> wrote:
>
> (Please keep the list in CC.)
>
> The output of
>
> get.models(models,subset=delta<5)
>
> would be more interesting. Or even better:
>
> lapply(get.models(models,subset=delta<5), formula)
>
> So that we see which formulas are being labelled as identical.
>
> Phillip
>
>> On 07/25/2018 04:56 PM, Helen McCallin wrote:
>> Hi Phil
>>
>> Thank you so much for your reply. Please find the codes I am using
>> below. Is this what you mean?
>>
>> ae <- read.csv(file=file.choose())
>>
>> options(na.action="na.fail")
>>
>> global.model<-glmer(
>>
>>
>> cbind(numerator,total-numerator)~d+s+t+p+d:s:t:p+d:s:t+d:s:p+d:t:p+s:t:p+d:t+d:s+d:p+s:t+s:p+t:p+(1|random),
>>
>> data=ae, family=binomial)
>>
>> options(max.print=1000000)
>>
>> dredge(global.model,beta=c("none"),evaluate=TRUE,rank="AICc")
>>
>> ae.model <- glmer(
>>
>>
>> cbind(numerator,total-numerator)~d+s+t+p+d:s:t:p+d:s:t+d:s:p+d:t:p+s:t:p+d:t+d:s+d:p+s:t+s:p+t:p+(1|random),
>>
>> data=ae,family=binomial)
>>
>> models <- dredge(ae.model)
>>
>> summary(model.avg(get.models(models,subset=delta<5)))
>>
>>
>> Many thanks for any help.
>>
>> Best wishes
>>
>> Helen
>>
>> On 25 Jul 2018, at 13:50, Phillip Alday <***@mpi.nl
>> <mailto:***@mpi.nl>> wrote:
>>
>>> Hi Helen,
>>>
>>> model.avg() tells you which models are duplicates. What do the formulas
>>> look like for those models? Seeing the formulae may help identify what
>>> model.avg() gets stuck on.
>>>
>>> Best,
>>> Phillip
>>>
>>>> On 07/23/2018 11:33 AM, Helen McCallin wrote:
>>>> Hi
>>>>
>>>>
>>>> I am running a glmer model on a response variable with binomial
>>>> distribution and random term. My data has 3 explanatory categorical
>>>> variables and I have successfully run dredge() on them and their
>>>> interactions to get AICc values.
>>>>
>>>>
>>>> I want model averaging to provide output with coefficients and an
>>>> index of relative importance of fixed effects from those models;
>>>> within a delta constraint that I specify.I can get this using the
>>>> code below for alternative datasets but not for this dataset.
>>>>
>>>>
>>>> model.avg() produces this error message:
>>>>
>>>> Error in model.avg.default(get.models(models, subset = delta < 5)) :
>>>> models are not unique. Duplicates: '2 = 3 = 4' and '10 = 11'
>>>>
>>>>
>>>> This doesn't make sense, DREDGE does not (cannot) produce duplicate
>>>> models – each model is a unique iteration within the full model, yet
>>>> the error message indicates that MODEL AVERAGE identified ‘duplicate’
>>>> models from within DREDGE output. R fails to run MODEL AVERAGE under
>>>> these circumstances - producing no further output.
>>>>
>>>>
>>>> Has anyone else experienced similar problem (with 'not unique',
>>>> duplicate models) via MODEL AVERAGE?
>>>>
>>>>
>>>> Is there a workaround for the error that prevents me running MODEL
>>>> AVERAGE due to perceived ‘duplicate’ models in DREDGE?
>>>>
>>>>
>>>> Many thanks for any help anyone can provide.
>>>>
>>>>
>>>>
>>>> [[alternative HTML version deleted]]
>>>>
>>>> _______________________________________________
>>>> R-sig-mixed-***@r-project.org
>>>> <mailto:R-sig-mixed-***@r-project.org> mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>>>
_______________________________________________
R-sig-mixed-***@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models


[[alternative HTML version deleted]]
Phillip Alday
2018-07-30 12:38:36 UTC
Permalink
In a previous message, one of the warnings was '2=3=4'. Assuming that
there's nothing weird about any internal sorting, that would mean these
models:

~ d + p + s + t + (1 | random) + d:t + p:s + p:t + s:t
~ d + p + s + t + (1 | random) + d:t + p:s + p:t + s:t + p:s:t
~ d + p + s + t + (1 | random) + d:p + p:s + p:t + s:t + p:s:t

They are similar but not identical in formula form: the first one is
missing the three-way interaction, while the the last two differ in the
two-way interaction involving d (d:t vs d:p). Are the models rank
deficient? i.e. are there combinations of factors that don't exist such
that these model terms get dropped? Try looking at these models and
seeing if there if a term is missing:

summary(get.models(models,subset=delta<5)$`9168`)

Or maybe see if the effective terms in each model are equivalent:

mod3 <- get.models(models,subset=delta<5)$`9168`
mod4 <- get.models(models,subset=delta<5)$`9120`

mean(sort(names(fixef(mod3))) == sort(names(fixef(mod4))))

If that last line return 1, then the models have identical fixed
effects, which combined with their identical random effects, you indeed
make them identical.

And this is a rather weird error -- I'm also grasping at straws here.

Phillip
Helen McCallin
2018-07-30 19:56:27 UTC
Permalink
Hi Phillip

Thank you for your reply.

I got the following output for the mean code 0.5714286. Would I need to try something further with this?

Many thanks again for your help.

Helen



> On 30 Jul 2018, at 13:38, Phillip Alday <***@mpi.nl> wrote:
>
> In a previous message, one of the warnings was '2=3=4'. Assuming that
> there's nothing weird about any internal sorting, that would mean these
> models:
>
> ~ d + p + s + t + (1 | random) + d:t + p:s + p:t + s:t
> ~ d + p + s + t + (1 | random) + d:t + p:s + p:t + s:t + p:s:t
> ~ d + p + s + t + (1 | random) + d:p + p:s + p:t + s:t + p:s:t
>
> They are similar but not identical in formula form: the first one is
> missing the three-way interaction, while the the last two differ in the
> two-way interaction involving d (d:t vs d:p). Are the models rank
> deficient? i.e. are there combinations of factors that don't exist such
> that these model terms get dropped? Try looking at these models and
> seeing if there if a term is missing:
>
> summary(get.models(models,subset=delta<5)$`9168`)
>
> Or maybe see if the effective terms in each model are equivalent:
>
> mod3 <- get.models(models,subset=delta<5)$`9168`
> mod4 <- get.models(models,subset=delta<5)$`9120`
>
> mean(sort(names(fixef(mod3))) == sort(names(fixef(mod4))))
>
> If that last line return 1, then the models have identical fixed
> effects, which combined with their identical random effects, you indeed
> make them identical.
>
> And this is a rather weird error -- I'm also grasping at straws here.
>
> Phillip
Phillip Alday
2018-07-31 13:28:05 UTC
Permalink
That means the model terms aren't identical, which admittedly doesn't
exclude different parameterizations of the same model. I'm at a loss
here, and I don't have time to look at your data even if you were
willing to share, though others on this list may be willing to do so.

Consider filing a bug report with the package maintainer, including
documentation of the extra output you've generated for me.

Good luck.
Phillip

On 07/30/2018 09:56 PM, Helen McCallin wrote:
> Hi Phillip
>
> Thank you for your reply.
>
> I got the following output for the mean code 0.5714286. Would I need to try something further with this?
>
> Many thanks again for your help.
>
> Helen
>
>
>
>> On 30 Jul 2018, at 13:38, Phillip Alday <***@mpi.nl> wrote:
>>
>> In a previous message, one of the warnings was '2=3=4'. Assuming that
>> there's nothing weird about any internal sorting, that would mean these
>> models:
>>
>> ~ d + p + s + t + (1 | random) + d:t + p:s + p:t + s:t
>> ~ d + p + s + t + (1 | random) + d:t + p:s + p:t + s:t + p:s:t
>> ~ d + p + s + t + (1 | random) + d:p + p:s + p:t + s:t + p:s:t
>>
>> They are similar but not identical in formula form: the first one is
>> missing the three-way interaction, while the the last two differ in the
>> two-way interaction involving d (d:t vs d:p). Are the models rank
>> deficient? i.e. are there combinations of factors that don't exist such
>> that these model terms get dropped? Try looking at these models and
>> seeing if there if a term is missing:
>>
>> summary(get.models(models,subset=delta<5)$`9168`)
>>
>> Or maybe see if the effective terms in each model are equivalent:
>>
>> mod3 <- get.models(models,subset=delta<5)$`9168`
>> mod4 <- get.models(models,subset=delta<5)$`9120`
>>
>> mean(sort(names(fixef(mod3))) == sort(names(fixef(mod4))))
>>
>> If that last line return 1, then the models have identical fixed
>> effects, which combined with their identical random effects, you indeed
>> make them identical.
>>
>> And this is a rather weird error -- I'm also grasping at straws here.
>>
>> Phillip
Helen McCallin
2018-07-31 13:55:57 UTC
Permalink
Hi Phillip

I understand and am very grateful for all the help you have given.

Many thanks

Helen

> On 31 Jul 2018, at 14:28, Phillip Alday <***@mpi.nl> wrote:
>
> That means the model terms aren't identical, which admittedly doesn't
> exclude different parameterizations of the same model. I'm at a loss
> here, and I don't have time to look at your data even if you were
> willing to share, though others on this list may be willing to do so.
>
> Consider filing a bug report with the package maintainer, including
> documentation of the extra output you've generated for me.
>
> Good luck.
> Phillip
>
>> On 07/30/2018 09:56 PM, Helen McCallin wrote:
>> Hi Phillip
>>
>> Thank you for your reply.
>>
>> I got the following output for the mean code 0.5714286. Would I need to try something further with this?
>>
>> Many thanks again for your help.
>>
>> Helen
>>
>>
>>
>>> On 30 Jul 2018, at 13:38, Phillip Alday <***@mpi.nl> wrote:
>>>
>>> In a previous message, one of the warnings was '2=3=4'. Assuming that
>>> there's nothing weird about any internal sorting, that would mean these
>>> models:
>>>
>>> ~ d + p + s + t + (1 | random) + d:t + p:s + p:t + s:t
>>> ~ d + p + s + t + (1 | random) + d:t + p:s + p:t + s:t + p:s:t
>>> ~ d + p + s + t + (1 | random) + d:p + p:s + p:t + s:t + p:s:t
>>>
>>> They are similar but not identical in formula form: the first one is
>>> missing the three-way interaction, while the the last two differ in the
>>> two-way interaction involving d (d:t vs d:p). Are the models rank
>>> deficient? i.e. are there combinations of factors that don't exist such
>>> that these model terms get dropped? Try looking at these models and
>>> seeing if there if a term is missing:
>>>
>>> summary(get.models(models,subset=delta<5)$`9168`)
>>>
>>> Or maybe see if the effective terms in each model are equivalent:
>>>
>>> mod3 <- get.models(models,subset=delta<5)$`9168`
>>> mod4 <- get.models(models,subset=delta<5)$`9120`
>>>
>>> mean(sort(names(fixef(mod3))) == sort(names(fixef(mod4))))
>>>
>>> If that last line return 1, then the models have identical fixed
>>> effects, which combined with their identical random effects, you indeed
>>> make them identical.
>>>
>>> And this is a rather weird error -- I'm also grasping at straws here.
>>>
>>> Phillip
Loading...