The HC05 is the 5th percentile hazardous concentration of a set of related 95th percentile extirpation concentration values (XC95). The HC05 is the estimated value of the stressor at which 5% of species will be extirpated.
# data
data(dta.do)
data(ss.sites)
# run function (~20 seconds)
dftv.do <- fish.wt.cdf(datafile = dta.do, ss = ss.sites, plot = T, dogam = T
, SampleID = "Station_Date", tag = "wt", sortvect = NULL
, np = 61, nt = 25, addtrend = T
, wd = getwd(), groups = c("BigHUC","ECOREGL3","WS_AREA")
, xvar = "cond")
View(dftv.do)
knitr::kable(head(dftv.do))
Then calculate the 5th quantile.
hc05_cdf <- quantile(dftv.do$XC95.cdf, probs = 0.05, na.rm = TRUE, type = 6)
hc05_gam <- quantile(dftv.do$XC95.gam, probs = 0.05, na.rm = TRUE, type = 6)
# both at once
hc05_both <- apply(dftv.do[, c("XC95.cdf", "XC95.gam")], 2
, quantile, probs=0.05, na.rm=TRUE, type=6)