Carolin
I've duplicated (with the minke data provided in the Distance package) your sequence of commands
library(Distance)
data(minke)
minke1 <- ds(data=minke, key="hn")
minke2 <- ds(data=minke, key="hr")
summarize_ds_models(minke1, minke2)
Model Key function Formula C-vM $p$-value $\\hat{P_a}$ se($\\hat{P_a}$) $\\Delta$AIC
1 \\texttt{minke1} Half-normal ~1 0.9292864 0.4519568 0.03470614 0.000000
2 \\texttt{minke2} Hazard-rate ~1 0.8477827 0.5010360 0.04753377 1.838793
without problem using the following versions of the packages of interest
other attached packages: [1] Distance_0.9.6 mrds_2.1.17
--
You received this message because you are subscribed to the Google Groups "distance-sampling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to distance-sampl...@googlegroups.com.
To post to this group, send email to distance...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/distance-sampling/e56e4494-68f1-45d1-8cfd-ae15dd5654cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- Eric Rexstad Research Unit for Wildlife Population Assessment Centre for Research into Ecological and Environmental Modelling University of St. Andrews St. Andrews Scotland KY16 9LZ +44 (0)1334 461833 The University of St Andrews is a charity registered in Scotland : No SC013532
Hi Eric,
Thanks for the thorough testing Carolin.
There are some subtle issues associated with summarize_ds_models() because that function is usually used for the purpose of model selection. To compare models (using AIC), the data used in the two models needs to be identical--otherwise the comparison is invalid. When data are not binned, the data used for multiple models is identical, therefore the AIC comparison is legitimate.
However, when binning occurs, the summarize_ds_models() function should also test whether the data used in the models being compared is identical. At the moment the function does not do that. In the second example you provided, the function should prevent you from comparing models fitted to unbinned and binned data (the result is invalid). The function should undertake that prevention in a nicer fashion than generating an error message.
To summarise, we should put a warning onto summarise_ds_models() that for the moment, it should only be used with models fitted to exact distance data. In a future version, the function should be more clever and come up with a comparison that if binned data are used, ensuring the cut points are identical. Likewise the function ought to check that the truncations distances for data in the models being considered is identical. Those checks are not yet in place so the user needs to police themselves.
I'll raise an issue about this problem on our software
development system. Thanks for spotting this.
--
You received this message because you are subscribed to the Google Groups "distance-sampling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to distance-sampl...@googlegroups.com.
To post to this group, send email to distance...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/distance-sampling/1e487004-d42f-4098-9175-37e2b275c813%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Caroline
Every analyst will want their own summaries of the analyses they have performed, so there is no generalised function beyond 'summarise_ds_models()' for that purpose. Your "rbind()" effort is as good as any method for your purposes.
R is lovely for providing the tools to make functions out of repetitive calculations. If you wish to have a summary of effective strip width, you could finish the function you began like this
ESW.calc <- function(my.ds.object) {
# calculates effective strip width
# given object created by function ds() of class
"dsmodel"
# Rexstad, 28Apr17
if (class(my.ds.object) != "dsmodel") stop("Argument is
not of class dsmodel")
my.summary <- summary(my.ds.object)
truncation <- my.ds.object$ddf$meta.data$width
average.p <- my.summary$ds$average.p
esw <- truncation * average.p
return(esw)
}
If you want a vertical line placed at ESW on your detection function plot, try
plot(minke1)
ESW.for.hn <- ESW.calc(minke1)
abline(v=ESW.for.hn, lwd=2)
To view this discussion on the web visit https://groups.google.com/d/msgid/distance-sampling/5edef7c3-1650-4e45-abe4-402f6b552baf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.