Learn R Programming

valytics (version 0.4.0)

precision_profile: Precision Profile Analysis

Description

Constructs a precision profile (CV vs concentration relationship) from precision study results and estimates functional sensitivity. The precision profile characterizes how measurement imprecision changes across the analytical measurement interval.

Usage

precision_profile(
  x,
  concentration = "concentration",
  cv = "cv_pct",
  model = c("hyperbolic", "linear"),
  cv_targets = c(10, 20),
  conf_level = 0.95,
  bootstrap = FALSE,
  boot_n = 1999
)

Value

An object of class c("precision_profile", "valytics_precision", "valytics_result"), which is a list containing:

input

List with original data:

  • concentration: Numeric vector of concentrations

  • cv: Numeric vector of CV values (percent)

  • n_levels: Number of concentration levels

  • conc_range: Concentration range (min, max)

  • conc_span: Fold-difference (max/min)

model

List with fitted model information:

  • type: Model type ("hyperbolic" or "linear")

  • parameters: Named vector of fitted parameters

  • equation: Character string describing the fitted equation

fitted

Data frame with fitted values:

  • concentration: Concentration values

  • cv_observed: Observed CV values

  • cv_fitted: Model-fitted CV values

  • residual: Residuals (observed - fitted)

  • ci_lower: Lower prediction interval

  • ci_upper: Upper prediction interval

fit_quality

List with goodness-of-fit statistics:

  • r_squared: Coefficient of determination

  • adj_r_squared: Adjusted R-squared

  • rmse: Root mean squared error

  • mae: Mean absolute error

functional_sensitivity

Data frame with functional sensitivity estimates:

  • cv_target: Target CV percentage

  • concentration: Estimated concentration at target CV

  • ci_lower: Lower confidence limit (if bootstrap)

  • ci_upper: Upper confidence limit (if bootstrap)

  • achievable: Logical; TRUE if target CV is achievable

settings

List with analysis settings

call

The matched function call

Arguments

x

An object of class precision_study with multiple concentration levels, OR a data frame with columns for concentration and CV values.

concentration

Character string specifying the column name for concentration values (only used if x is a data frame). Default is "concentration".

cv

Character string specifying the column name for CV values (only used if x is a data frame). Default is "cv_pct".

model

Regression model for CV-concentration relationship: "hyperbolic" (default) fits CV = sqrt(a^2 + (b/x)^2), "linear" fits CV = a + b/x.

cv_targets

Numeric vector of target CV percentages for functional sensitivity estimation. Default is c(10, 20).

conf_level

Confidence level for prediction intervals (default: 0.95).

bootstrap

Logical; if TRUE, uses bootstrap resampling for confidence intervals on functional sensitivity estimates. Default is FALSE.

boot_n

Number of bootstrap resamples when bootstrap = TRUE (default: 1999).

Minimum Requirements

  • At least 4 concentration levels

  • Concentration span of at least 2-fold (warning if less)

  • Valid CV estimates at each level (from precision study)

Details

Precision Profile:

The precision profile describes how analytical imprecision (CV) varies across the analytical measurement interval. Typically, CV decreases as concentration increases, following a hyperbolic relationship.

Hyperbolic Model:

The hyperbolic model is: $$CV = \sqrt{a^2 + (b/x)^2}$$

where:

  • a represents the asymptotic CV at high concentrations

  • b represents the concentration-dependent component

  • x is the analyte concentration

This model captures the characteristic behavior where CV approaches a constant value at high concentrations and increases hyperbolically at low concentrations.

Linear Model:

The linear model is: $$CV = a + b/x$$

This is a simpler alternative that may be appropriate when the relationship is approximately linear when plotted as CV vs 1/concentration.

Functional Sensitivity:

Functional sensitivity is defined as the lowest concentration at which a measurement procedure achieves a specified level of precision (CV). Common thresholds are:

  • 10% CV: Modern standard for high-sensitivity assays (e.g., cardiac troponin)

  • 20% CV: Traditional standard (originally defined for TSH assays)

The functional sensitivity is calculated by solving the fitted model equation for the concentration that yields the target CV.

References

Armbruster DA, Pry T (2008). Limit of blank, limit of detection and limit of quantitation. Clinical Biochemist Reviews, 29(Suppl 1):S49-S52.

CLSI EP17-A2 (2012). Evaluation of Detection Capability for Clinical Laboratory Measurement Procedures; Approved Guideline - Second Edition. Clinical and Laboratory Standards Institute, Wayne, PA.

Kroll MH, Emancipator K (1993). A theoretical evaluation of linearity. Clinical Chemistry, 39(3):405-413.

See Also

precision_study() for variance component analysis, plot.precision_profile() for visualization

Examples

Run this code
# Example with simulated multi-level precision data
set.seed(42)

# Generate data for 6 concentration levels
conc_levels <- c(5, 10, 25, 50, 100, 200)
n_levels <- length(conc_levels)

prec_data <- data.frame()
for (i in seq_along(conc_levels)) {
  level_data <- expand.grid(
    level = conc_levels[i],
    day = 1:5,
    replicate = 1:5
  )
  
  # Simulate CV that decreases with concentration
  true_cv <- sqrt(3^2 + (20/conc_levels[i])^2)
  level_data$value <- conc_levels[i] * rnorm(
    nrow(level_data),
    mean = 1,
    sd = true_cv/100
  )
  
  prec_data <- rbind(prec_data, level_data)
}

# Run precision study
prec <- precision_study(
  data = prec_data,
  value = "value",
  sample = "level",
  day = "day"
)

# Generate precision profile
profile <- precision_profile(prec)
print(profile)
summary(profile)

# Hyperbolic model with bootstrap CIs
profile_boot <- precision_profile(
  prec,
  model = "hyperbolic",
  cv_targets = c(10, 20),
  bootstrap = TRUE,
  boot_n = 499
)

# Linear model
profile_linear <- precision_profile(prec, model = "linear")

Run the code above in your browser using DataLab