conf_int | R Documentation |
Function to calculate confidence intervals
conf_int(
df,
analysis_result = "analysis_result",
distribution = "distribution",
method = "mvue",
ci_type = "two-sided",
conf_level = 0.95
)
df |
df data frame of groundwater data in tidy format |
analysis_result |
the analysis result column |
distribution |
the distribution column |
method |
character string specifying the method of estimation. Possible values are "mvue" (minimum variance unbiased; the default), and "mle/mme" (maximum likelihood/method of moments). |
ci_type |
character string indicating what kind of confidence interval to compute. The possible values are ci_type="two-sided" (the default), ci_type="lower", and ci_type = "upper |
conf_level |
a scalar between 0 and 1 indicating the confidence level of the prediction interval. The default value is conf_level = 0.95 |
data("gw_data")
wells <- c("MW-1", "MW-2", "MW-3", "MW-4")
params <- c("Sulfate, total",
"Arsenic, dissolved",
"Boron, dissolved")
background <- lubridate::ymd(c("2007-12-20", "2012-01-01"), tz = "UTC")
# first group data by location, param, and background
# estimate percent less than and distribution
background_data <- gw_data %>%
filter(location_id %in% wells, param_name %in% params,
sample_date >= background[1] & sample_date <= background[2]) %>%
group_by(location_id, param_name, default_unit) %>%
percent_lt() %>%
est_dist(., keep_data_object = TRUE) %>%
arrange(location_id, param_name)
background_data %>%
conf_int(., ci_type = "lower", conf_level = 0.99)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.