unmarked returns AIC rather than AICc because it is not clear, to me
at least, what the effective sample size is for these models. I think
this issue was discussed in a previous thread and in the MacKenzie et
al 2005 book.
As for model averaging, see help(fitList). Basically, you put your
models in a fitList object, and then you use predict:
fmList <- fitList(m1, m2, m3, etc...) # put models in a fitList object
predict(fmList, type="state") # expected values for
original data. or,
predict(fmList, type="state", newdata = somenewdata)
This will give you model-averaged predictions and SEs. We have
intentionally not provided capabilities for model-averaging beta
coefficients or variance-covariance matrices.
Richard
On Mon, Oct 11, 2010 at 3:37 AM, Matthew Giovanni
<matthew...@gmail.com> wrote:
> Hi Richard-
>
> I'm wondering if unmarked has functions or options to calculate and return
> AICc values from a fitList object, rather than just AIC. Also, I was
> reading the users manual and there is some mention of calculating
> model-averaged coeffs and preds in unmarked, but I haven't been able to
> figure out an efficient way of doing so. Any insights or suggestions? Here
> are example data and R files if that helps. Thanks for your help and
> expertise, as always.
>
> Matt
> ____________________________________
> Matt Giovanni
> Postdoctoral Visiting Research Fellow
> Canadian Wildlife Service
> 2365 Albert St., Room 300
> Regina, SK S4P 4K1
> 306-780-6121 work
> 402-617-3764 mobile
> Research website:
> http://sites.google.com/site/matthewgiovanni/
>
To: unmarked <unma...@googlegroups.com>
From: Giancarlo Sadoti <gcsa...@gmail.com>
Sent by: unma...@googlegroups.com
Date: 11/13/2010 11:05PM
Subject: [unmarked] Re: model selection and averaging in unmarked?
Hi Pablo
It would be helpful to see the code you used to run the models across which you are trying to average.
Thanks
Chris
From: unma...@googlegroups.com [mailto:unma...@googlegroups.com] On Behalf Of Pablo
Sent: Wednesday, May 29, 2013 6:47 PM
To: unma...@googlegroups.com
Cc: Matthew Giovanni
Subject: [unmarked] Re: model selection and averaging in unmarked?
Dear Marc,
--
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
model.avg(fms2,subset=delta < 2)
Error in model.avg.default(fms2, subset = delta < 2) :
object 'delta' not found
Any input or help will be appreciated, thank you so much for taking a look to this issue.
Best,
Pablo
Pablo,
I think this might just be a case of putting the right object into the mod.avg()function.
You have:
model.avg(fms2,subset=delta < 2)
Where fms2 is a fitList and not a modSel object so there is no delta to be used for the subsetting <- source of error. So try this out:
ms1 <- modSel(fms2)
model.avg(ms1,subset=delta < 2)
Sorry for delay in my response having asked to see a bit more. I hope that helps…?
Pablo,
Looking through this string it appears you used the fitlist in the model.avg function instead of a model selection table.
Maybe try the following instead.
>models=modSel(fms2)>model.avg(models,subset=delta < 2)
Thanks,
Matthew Butler
On Monday, August 19, 2013 1:57:10 PM UTC-6, Pablo wrote:
Hi Richard,
I tried your suggestion and get theseᅵ
ᅵmodel ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ formula lam(AgroFo) SElam(AgroFo) ᅵlam(Int)2 ᅵ ᅵHabitat ~Obs + Wind ~ Wetland + AgroFo + SecVeg + Wetland ᅵ 0.6750684 ᅵ ᅵ 0.2653434 -1.5435623 ᅵ ᅵ Hab_PN ᅵ ᅵ ᅵ~Obs + Wind ~ Wetland + AgroFo + SecVeg + PN ᅵ 0.7593324 ᅵ ᅵ 0.2690820 -1.2957187 Hab_LNEdge ᅵ~Obs + Wind ~ Wetland + AgroFo + SecVeg + LNEdge ᅵ 0.7409290 ᅵ ᅵ 0.2685012 -1.500183ᅵ SElam(Int) lam(LNEdge) SElam(LNEdge) ᅵ ᅵlam(PN) SElam(PN) lam(SecVeg) SElam(SecVeg) lam(Wetland)2 ᅵ0.1608800 ᅵ ᅵ ᅵ ᅵ ᅵNA ᅵ ᅵ ᅵ ᅵ ᅵ ᅵNA ᅵ ᅵ ᅵ ᅵ NA ᅵ ᅵ ᅵ ᅵNA ᅵ 0.8380666 ᅵ ᅵ 0.3485525 ᅵ ᅵ 1.4313273 ᅵ0.2573567 ᅵ ᅵ ᅵ ᅵ ᅵNA ᅵ ᅵ ᅵ ᅵ ᅵ ᅵNA -0.2044303 0.1680027 ᅵ 0.9959054 ᅵ ᅵ 0.3605524 ᅵ ᅵ 1.4054867 ᅵ0.1644069 -0.04018447 ᅵ ᅵ0.03704068 ᅵ ᅵ ᅵ ᅵ NA ᅵ ᅵ ᅵ ᅵNA ᅵ 0.9801160 ᅵ ᅵ 0.3628843 ᅵ ᅵ 1.413577ᅵ SElam(Wetland) p(sigma(Intercept)) SEp(sigma(Intercept)) p(sigmaObsE) SEp(sigmaObsE) p(sigmaObsJ)2 ᅵ ᅵ ᅵ0.1880082 ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ3.985389 ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ0.09493167 ᅵ ᅵ0.1552567 ᅵ ᅵ ᅵ0.1080814 ᅵ ᅵ0.13460023 ᅵ ᅵ ᅵ0.1882181 ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ3.983239 ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ0.09454148 ᅵ ᅵ0.1667710 ᅵ ᅵ ᅵ0.1084129 ᅵ ᅵ0.14784937 ᅵ ᅵ ᅵ0.1875546 ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ3.988795 ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ0.09507646 ᅵ ᅵ0.1600893 ᅵ ᅵ ᅵ0.1082677 ᅵ ᅵ0.1406727ᅵ SEp(sigmaObsJ) p(sigmaObsP) SEp(sigmaObsP) p(sigmaWind) SEp(sigmaWind) Converge ᅵCondNum negLogLike2 ᅵ ᅵ ᅵ0.1156136 ᅵ ᅵ0.2289370 ᅵ ᅵ 0.09263715 ᅵ-0.04876901 ᅵ ᅵ 0.02897823 ᅵ ᅵ ᅵ ᅵ0 864.3129 ᅵ 489.02753 ᅵ ᅵ ᅵ0.1162355 ᅵ ᅵ0.2366194 ᅵ ᅵ 0.09242013 ᅵ-0.05161521 ᅵ ᅵ 0.02914716 ᅵ ᅵ ᅵ ᅵ0 928.8630 ᅵ 488.25647 ᅵ ᅵ ᅵ0.1159805 ᅵ ᅵ0.2316956 ᅵ ᅵ 0.09255071 ᅵ-0.05204200 ᅵ ᅵ 0.02920309 ᅵ ᅵ ᅵ ᅵ0 948.6319 ᅵ 488.4290ᅵ nPars ᅵ n ᅵ ᅵ ᅵAIC ᅵ ᅵ delta ᅵ ᅵ AICwt Rsq ᅵcumltvWt2 ᅵ ᅵ 9 234 996.0549 0.0000000 0.3626489 ᅵNA 0.36264893 ᅵ ᅵ10 234 996.5129 0.4579434 0.2884332 ᅵNA 0.65108217 ᅵ ᅵ10 234 996.8579 0.8029949 0.2427271 ᅵNA 0.8938092
Which is a subset of the models under to AIC, however is not the average.
I tried toᅵmodel.avg(subset(ms1df,delta<2)) to see if this work but it does not. The error message isᅵ
Error in model.avg.default(subset(ms1df, delta < 2)) :ᅵᅵ only one model supplied. Nothing to do
Once again I would appreciate any comments.ᅵ
Have a great week.
Pablo
On Sun, Jul 28, 2013 at 6:59 AM, Richard Chandler <richard....@gmail.com> wrote:
Hi Pablo,
You could do something like:
ms1df <- as(ms1, "data.frame")subset(ms1df, delta<2)
Richard
On Mon, Jul 22, 2013 at 6:04 PM, Pablo <pcol...@gmail.com> wrote:
Hi Chris,
Thanks for the reply. I tried and still says that object delta is not foundᅵ
ᅵms1<-modSel(fms2)> ms1ᅵ ᅵ ᅵ ᅵ ᅵ ᅵnPars ᅵ ᅵAIC delta ᅵ AICwt cumltvWtHabitat ᅵ ᅵ ᅵ ᅵ7 458.11 ᅵ0.00 0.51678 ᅵ ᅵ 0.52Hab_PN ᅵ ᅵ ᅵ ᅵ 8 459.99 ᅵ1.87 0.20257 ᅵ ᅵ 0.72Hab_LNEdge ᅵ ᅵ 8 460.02 ᅵ1.91 0.19918 ᅵ ᅵ 0.92Global ᅵ ᅵ ᅵ ᅵ 9 461.99 ᅵ3.88 0.07444 ᅵ ᅵ 0.99PN ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ 5 468.07 ᅵ9.95 0.00356 ᅵ ᅵ 1.00PN_LNEdge ᅵ ᅵ ᅵ6 469.98 11.87 0.00137 ᅵ ᅵ 1.00LNEdge ᅵ ᅵ ᅵ ᅵ 6 469.98 11.87 0.00137 ᅵ ᅵ 1.00Null_Null ᅵ ᅵ ᅵ4 471.25 13.14 0.00072 ᅵ ᅵ 1.00> ms1<-modSel(fms2)> model.avg(ms1,subset=delta<2)Error in model.avg.default(ms1, subset = delta < 2) :ᅵᅵ object 'delta' not found
Thanks for the help and sorry that I did not reply before I was busy and getting ready for fieldwork . If you have another idea that I can try please let me know.
Thanks,
Pablo
On Tuesday, June 4, 2013 7:44:26 AM UTC-5, chrissuthy wrote:
Pablo,
ᅵ
I think this might just be a case of putting the right object into the mod.avg()function.
You have:
ᅵ
model.avg(fms2,subset=delta < 2)
ᅵ
Where fms2 is a fitList and not a modSel object so there is no delta to be used for the subsetting <- source of error. So try this out:
ᅵ
ms1 <- modSel(fms2)
model.avg(ms1,subset=delta < 2)
ᅵ
Sorry for delay in my response having asked to see a bit more. I hope that helps…?
ᅵ
Chris
ᅵ
ᅵ
From: unma...@googlegroups.com [mailto:unma...@googlegroups.com] On Behalf Of Pablo
Sent: Thursday, May 30, 2013 11:18 AM
To: unma...@googlegroups.com
Cc: 'Matthew Giovanni'
Subject: Re: [unmarked] Re: model selection and averaging in unmarked?
ᅵ
Chris,ᅵ
These are a sample of the models that I am using, ᅵ
ᅵ
> Habitat<-distsamp(~1~AgroFo+Wetland+SecVeg,keyfun="hazard", unitsOut="ha", output="density",data=umf) ᅵᅵ
> Hab_StdElev<-distsamp(~1~AgroFo+Wetland+SecVeg+StdElev,keyfun="hazard", unitsOut="ha", output="density",data=umf)
ᅵ
then I create a fitList
ᅵ
fms2<-fitList('StdElev'=StdElev,'Null_Null'=Null_Null,'Habitat'=Habitat,'Hab_StdElev'=Hab_StdElev,'Hab_PN'=Hab_PN,'PN_LNEdge'=PN_LNEdge,
+ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ 'PN'=PN,'LNEdge'=LNEdge,'Hab_LNEdge'=Hab_LNEdge,'StdElev_PN'=StdElev_PN,'StdElev_LNEdge'=StdElev_LNEdge,'H_SEl_LEd'=H_SEl_LEd,'Global'=Global)
ᅵ
modSel(fms2)
ᅵ
The result from this is this tableᅵ
ᅵ
ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵnPars ᅵ ᅵ AIC delta ᅵ AICwt cumltvWt
Habitat ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ6 1377.63 ᅵ0.00 3.8e-01 ᅵ ᅵ 0.38
Hab_StdElev ᅵ ᅵ ᅵ ᅵ7 1378.98 ᅵ1.35 1.9e-01 ᅵ ᅵ 0.57
Hab_PN ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ 7 1379.24 ᅵ1.61 1.7e-01 ᅵ ᅵ 0.74
Hab_LNEdge ᅵ ᅵ ᅵ ᅵ 7 1379.50 ᅵ1.87 1.5e-01 ᅵ ᅵ 0.89
H_SEl_LEd ᅵ ᅵ ᅵ ᅵ ᅵ8 1380.93 ᅵ3.30 7.3e-02 ᅵ ᅵ 0.96
Global ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ 9 1382.47 ᅵ4.84 3.4e-02 ᅵ ᅵ 1.00
StdElev ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ4 1391.01 13.38 4.7e-04 ᅵ ᅵ 1.00
StdElev_PN ᅵ ᅵ ᅵ ᅵ 5 1391.10 13.47 4.5e-04 ᅵ ᅵ 1.00
StdElev_LNEdge ᅵ ᅵ 5 1391.23 13.60 4.2e-04 ᅵ ᅵ 1.00
PN ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ 4 1396.54 18.91 3.0e-05 ᅵ ᅵ 1.00
Null_Null ᅵ ᅵ ᅵ ᅵ ᅵ3 1398.19 20.56 1.3e-05 ᅵ ᅵ 1.00
PN_LNEdge ᅵ ᅵ ᅵ ᅵ ᅵ5 1398.37 20.74 1.2e-05 ᅵ ᅵ 1.00
LNEdge ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ 5 1398.37 20.74 1.2e-05 ᅵ ᅵ 1.00ᅵ
ᅵ
I try to use the command, but I get this error message.
ᅵ
ᅵmodel.avg(fms2,subset=delta < 2)
Error in model.avg.default(fms2, subset = delta < 2) :ᅵ
ᅵ object 'delta' not found
ᅵ
Any input or help will be appreciated, thank you so much for taking a look to this issue.
Best,
Pablo
ᅵ
ᅵ
ᅵ
On Wednesday, May 29, 2013 9:59:24 PM UTC-5, chrissuthy wrote:
Hi Pablo
ᅵ
It would be helpful to see the code you used to run the models across which you are trying to average.
ᅵ
Thanks
ᅵ
Chris
ᅵ
From: unma...@googlegroups.com [mailto:unma...@googlegroups.com] On Behalf Of Pablo
Sent: Wednesday, May 29, 2013 6:47 PM
To: unma...@googlegroups.com
Cc: Matthew Giovanni
Subject: [unmarked] Re: model selection and averaging in unmarked?
ᅵ
Dear Marc,
ᅵ
I am learning how to use distamp and occu and for my project I need to average models under 2 AIC and AICc points. I need to obtain coefficients of the averaged models, in occu I was able to obtain those with theᅵmodel.avg(ms1,subset=delta < 2) function ,
ᅵ
ᅵbut in distsamp I receive this message error
ᅵ
ᅵmodel.avg(fms2,subset=delta < 2)
Error in model.avg.default(fms2, subset = delta < 2) :ᅵ
ᅵ object 'delta' not found
ᅵ
I been trying to find out what is my mistake or if possible to average models for distsamp function with no success.
I will appreciate any help that you can provide.
ᅵ
Sincerely ,
ᅵ
Pablo Oleiro
On Monday, October 11, 2010 6:59:41 AM UTC-5, Richard Chandler wrote:Hi Matt,
unmarked returns AIC rather than AICc because it is not clear, to me
at least, what the effective sample size is for these models. I think
this issue was discussed in a previous thread and in the MacKenzie et
al 2005 book.As for model averaging, see help(fitList). Basically, you put your
models in a fitList object, and then you use predict:
fmList <- fitList(m1, m2, m3, etc...) ᅵ# put models in a fitList object
predict(fmList, type="state") ᅵ ᅵ ᅵ ᅵ ᅵ ᅵ# expected values for
original data. or,
predict(fmList, type="state", newdata = somenewdata)
This will give you model-averaged predictions and SEs. We have
intentionally not provided capabilities for model-averaging beta
coefficients or variance-covariance matrices.Richard
On Mon, Oct 11, 2010 at 3:37 AM, Matthew Giovanni
<matthew...@gmail.com> wrote:
> Hi Richard-
>
> I'm wondering if unmarked has functions or options to calculate and return
> AICc values from a fitList object, rather than just AIC.ᅵ Also, I was
> reading the users manual and there is some mention of calculating
> model-averaged coeffs and preds in unmarked, but I haven't been able to
> figure out an efficient way of doing so.ᅵ Any insights or suggestions?ᅵ Here
> are example data and R files if that helps.ᅵ Thanks for your help and
> expertise, as always.
>
> Matt
> ____________________________________
> Matt Giovanni
> Postdoctoral Visiting Research Fellow
> Canadian Wildlife Service
> 2365 Albert St., Room 300
> Regina, SK S4P 4K1
> 306-780-6121 work
> 402-617-3764 mobile
> Research website:
> http://sites.google.com/site/matthewgiovanni/
>
--
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
ᅵ
ᅵ
--
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
ᅵ
ᅵ
--
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
ᅵ
ᅵ
--
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
ᅵ
ᅵ
Richard,
I tried the dredge function and it does not work , this is the error message, that I get.
Error in names(ret) <- sapply(x@estimates@estimates, slot, "short.name") :ᅵᅵ 'names' attribute [3] must be the same length as the vector [2]
I was wondering if there is a dredge function for ᅵthe distsamp function. I used ᅵwith occu function and works fine.ᅵ
This whole process is because the avg function in occu gives you the average parameters for your covariates and the average of the standard errors which I need for the second part of my project. If you have a better idea to estimate the average error of my models I will appreciate . Once again, thanks for all the help and sorry for all the questions.
Pablo
modavg.unmarked(cand.set=cand.mod, parm="logArea", modnames=names, second.ord=TRUE, nobs=NULL, c.hat=1, conf.level=0.95, exclude=NULL, parm.type='detect', uncond.se="revised")