Discussion:
[R-sig-ME] Questions regarding MODEL AVERAGING output
Helen McCallin
2018-07-13 17:17:48 UTC
Permalink
Hi

I would like to post the following question to the forum please?


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.

This is what I have input.

ae <- read.csv(file=file.choose())

options(na.action="na.fail")

global.model<-glmer(

cbind(numerator,total-numerator)~d+s+t+d:s:t+d:s+d:t+s:t+(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+d:s:t+d:s+d:t+s:t+(1|random),

data=ae,family=binomial)

models <- dredge(ae.model)

summary(model.avg(get.models(models,subset=delta<5)))

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?
I am happy to provide Dropbox link to data.

Thanks in advance for any help given. Summary of data below:

summary(ae)

p t day hour scan random behaviour

ae:182 blood :42 Min. :1.000 Min. :1.000 Min. : 0 ae_blood_1_1: 7 alert:182

egg :35 1st Qu.:1.000 1st Qu.:1.000 1st Qu.:10 ae_blood_1_2: 7

repellentfree:63 Median :2.000 Median :2.000 Median :30 ae_blood_1_3: 7

wolf :42 Mean :1.654 Mean :1.962 Mean :30 ae_blood_2_1: 7

3rd Qu.:2.000 3rd Qu.:3.000 3rd Qu.:50 ae_blood_2_2: 7

Max. :3.000 Max. :3.000 Max. :60 ae_blood_2_3: 7

(Other) :140

numerator total proportion percentage d s

Min. : 0.0000 Min. :17 Min. :0.00000 Min. : 0.000 E :14 1 - very light wind:21

1st Qu.: 0.0000 1st Qu.:17 1st Qu.:0.00000 1st Qu.: 0.000 SE:84 2 - light wind :70

Median : 0.0000 Median :17 Median :0.00000 Median : 0.000 SW:35 3 - moderate wind :77

Mean : 0.5824 Mean :17 Mean :0.03426 Mean : 3.426 W :49 4 - heavy wind :14

3rd Qu.: 0.0000 3rd Qu.:17 3rd Qu.:0.00000 3rd Qu.: 0.000

Max. :16.0000 Max. :17 Max. :0.94118 Max. :94.118


Many thanks for your help

Helen McCallin

[[alternative HTML version deleted]]
Helen McCallin
2018-07-13 17:35:02 UTC
Permalink
Please find attached question in Notepad form.

Kind regards

Helen
From: Helen McCallin<mailto:***@hotmail.com>
Sent: 13 July 2018 18:18
To: r-sig-mixed-***@r-project.org <mailto:r-sig-mixed-***@r-project.org>
Subject: [R-sig-ME] Questions regarding MODEL AVERAGING output

Hi

I would like to post the following question to the forum please?


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.

This is what I have input.

ae <- read.csv(file=file.choose())

options(na.action="na.fail")

global.model<-glmer(

cbind(numerator,total-numerator)~d+s+t+d:s:t+d:s+d:t+s:t+(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+d:s:t+d:s+d:t+s:t+(1|random),

data=ae,family=binomial)

models <- dredge(ae.model)

summary(model.avg(get.models(models,subset=delta<5)))

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?
I am happy to provide Dropbox link to data.

Thanks in advance for any help given. Summary of data below:

summary(ae)

p t day hour scan random behaviour

ae:182 blood :42 Min. :1.000 Min. :1.000 Min. : 0 ae_blood_1_1: 7 alert:182

egg :35 1st Qu.:1.000 1st Qu.:1.000 1st Qu.:10 ae_blood_1_2: 7

repellentfree:63 Median :2.000 Median :2.000 Median :30 ae_blood_1_3: 7

wolf :42 Mean :1.654 Mean :1.962 Mean :30 ae_blood_2_1: 7

3rd Qu.:2.000 3rd Qu.:3.000 3rd Qu.:50 ae_blood_2_2: 7

Max. :3.000 Max. :3.000 Max. :60 ae_blood_2_3: 7

(Other) :140

numerator total proportion percentage d s

Min. : 0.0000 Min. :17 Min. :0.00000 Min. : 0.000 E :14 1 - very light wind:21

1st Qu.: 0.0000 1st Qu.:17 1st Qu.:0.00000 1st Qu.: 0.000 SE:84 2 - light wind :70

Median : 0.0000 Median :17 Median :0.00000 Median : 0.000 SW:35 3 - moderate wind :77

Mean : 0.5824 Mean :17 Mean :0.03426 Mean : 3.426 W :49 4 - heavy wind :14

3rd Qu.: 0.0000 3rd Qu.:17 3rd Qu.:0.00000 3rd Qu.: 0.000

Max. :16.0000 Max. :17 Max. :0.94118 Max. :94.118


Many thanks for your help

Helen McCallin

[[alternative HTML version deleted]]


[[alternative HTML version deleted]]

Loading...