Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Description: A simple way of fitting detection functions to distance sampling
Horvitz-Thompson-like estimator) if survey area information is provided. See
Miller et al. (2019) <doi:10.18637/jss.v089.i01> for more information on
methods and <https://distancesampling.org/resources/vignettes.html> for example analyses.
Version: 2.0.1
Version: 2.0.1.9000
URL: https://github.com/DistanceDevelopment/Distance/
BugReports: https://github.com/DistanceDevelopment/Distance/issues
Language: en-GB
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Distance 2.0.2

* Added argument conf_level to ds so users can specify level of confidence in computing confidence intervals (Issue #215)

# Distance 2.0.1

* Fixes issue with print dht2 when multipliers are a data.frame (Issue #179)
Expand Down
8 changes: 7 additions & 1 deletion R/ds.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
#' @param winebin If you are trying to use our MCDS.exe optimizer on a
#' non-windows system then you may need to specify the winebin. Please
#' see [`mcds_dot_exe`][mrds::mcds_dot_exe] for more details.
#' @param conf_level level of confidence used in computations of confidence interval width: default 0.95, must be between 0 and 1
#' @param dht.group deprecated, see same argument with underscore, above.
#' @param region.table deprecated, see same argument with underscore, above.
#' @param sample.table deprecated, see same argument with underscore, above.
Expand Down Expand Up @@ -340,6 +341,7 @@ ds <- function(data, truncation=ifelse(is.null(data$distend),
initial_values=NULL, max_adjustments=5, er_method=2, dht_se=TRUE,
optimizer = "both",
winebin = NULL,
conf_level = 0.95,
# deprecated below here:
dht.group,
region.table,
Expand Down Expand Up @@ -531,6 +533,9 @@ ds <- function(data, truncation=ifelse(is.null(data$distend),
stop("Cannot supply initial values when using AIC term selection")
}

# check conf_level
if(!((conf_level >= 0) | (conf_level <= 1))) stop("Option conf_level is not in the range 0-1")

### Actually fit some models here

# construct the meta data object...
Expand Down Expand Up @@ -731,7 +736,8 @@ ds <- function(data, truncation=ifelse(is.null(data$distend),
dht_options <- list(group = dht_group,
ervar = er_var,
varflag = er_method,
convert.units = convert_units)
convert.units = convert_units,
ci.width = conf_level)

# if no obs_table
if(is.null(obs_table)){
Expand Down
Loading