Calculates the limit of quantitation using one of several accepted methods. The method used is explicitly documented in the output.
Usage
measure_loq(
data,
response_col,
method = c("blank_sd", "calibration", "sn", "precision"),
conc_col = "nominal_conc",
sample_type_col = "sample_type",
calibration = NULL,
k = 10,
sn_col = NULL,
noise = NULL,
sn_threshold = 10,
precision_cv = 20,
...
)Arguments
- data
A data frame containing the measurement data.
- response_col
Name of the response column.
- method
Method for LOD calculation:
"blank_sd": 3 * SD of blank samples (requiressample_type == "blank")"calibration": 3.3 * sigma / slope from calibration curve"sn": Signal-to-noise ratio method (requiressn_color noise estimate)"precision": Based on acceptable precision at low concentrations
- conc_col
Name of concentration column (for calibration method).
- sample_type_col
Name of sample type column. Default is
"sample_type".- calibration
Optional measure_calibration object for calibration method.
- k
Multiplier for SD. Default is 10 for LOQ.
- sn_col
Column containing S/N ratios (for
"sn"method).- noise
Noise estimate for S/N calculation (alternative to
sn_col).- sn_threshold
S/N threshold for LOQ (default 10).
- precision_cv
Maximum allowable CV for LOQ (default 20%).
- ...
Additional arguments passed to method-specific calculations.
Value
A measure_loq object containing:
value: The LOQ valuemethod: Method usedparameters: Method-specific parametersuncertainty: Uncertainty estimate (when available)
Details
Blank SD Method
LOQ = mean(blank) + k * SD(blank)
Where k is typically 10. This is a simple but widely accepted approach.
See also
measure_lod() for limit of detection,
measure_lod_loq() for calculating both together.
Examples
# Create sample data with blanks
data <- data.frame(
sample_type = c(rep("blank", 10), rep("standard", 5)),
response = c(rnorm(10, mean = 0.5, sd = 0.1),
c(5, 15, 35, 70, 150)),
nominal_conc = c(rep(0, 10), c(10, 25, 50, 100, 200))
)
# LOQ from blank SD
measure_loq(data, "response", method = "blank_sd")
#> <measure_loq>
#> Value: 1.537
#> Method: blank_sd
#> k: 10
#> Uncertainty: 0.3326
#> Parameters:
#> blank_mean: 0.4853
#> blank_sd: 0.1052
#> n_blanks: 10