Learn R Programming

CLSIEP15

This package aims on Clinical and Laboratory Standards Institute (CLSI) EP15-A3 Calculations

CLSI EP15-A3 provides guidance on the user verification of precision and the estimation of bias for laboratory test methods. It outlines the steps and procedures that clinical laboratories should follow to evaluate the performance of a test method they intend to implement.

This package is a R implementation of the calculations used in the document

Install

devtools::install_github('clauciorank/CLSIEP15')

library(CLSIEP15)

Usage

Create a table in the specified format

Wider Format

repRun_1Run_2Run_3Run_4Run_5
1140140140141139
2139143138144140
3138141136142141
4138143141143138
5140137136144141

Long Format

repnamevalue
1Run_1140
1Run_2140
1Run_3140
1Run_4141
1Run_5139
2Run_1139
2Run_2143
2Run_3138
2Run_4144
2Run_5140
.........

ferritin_long and ferritin_wider are provided as data in the package and can be used as example

For long format

data <- create_table_ep_15(ferritin_long, data_type = 'long')

For wide format

data <- create_table_ep_15(ferritin_wider)

Precision

Calculate Anova parameters and Imprecision Estimates

aov_t <- calculate_aov_infos(data)

If user repetibility(SR or CVR) < repetibility claim and Within-lab(SWL or CVWL) < Within-lab claim the user has verified manufacture's precision claims if not the upper verification limit (UVL) should be checked

uvl_info <- calculate_uvl_info(aov_return = aov_t, cvr_or_sr = .43, cvwl_or_swl = .7)

Where arguments are the follow:

  • aov_return: Return of calculate_aov_info()

  • nsamp: number of samples in the experiment. Default is 1

  • cvr_or_sr: Desirable CV or S repetability

  • cvwl_or_swl: Desirable CV or S within-lab

Rechek If user repetibility(SR or CVR) < UVL repetibility claim and Within-lab(SWL or CVWL) < UVL Within-lab claim

Bias

For calculating a range for acceptable bias different scenarios and subscenarios are provided by the document

calculate_bias_interval is the function used:

calculate_bias_interval( scenario, nrun, nrep, SWL, SR, nsamples, expected_mean, user_mean, ... )

These are the mandatory parameters:

  • scenario: Choosed scenario from section 3.3 of EP15-A3

  • nrun: Number of runs

  • nrep: number of repetitions per run (n0)

  • SWL: S within laboratory (obtained from anova)

  • SR: S repetability (obtained from anova)

  • nsamples: total number of samples tested usual 1

  • expected_mean: Expected mean or TV

  • user_mean: Mean of all samples (obtained from anova)

  • ... : additional parameters necessary for processing the choosed scenario

Scenario A:

Bona fide reference materials, can vary depending on the information provided by the manufacturer.

  • Sub scenario "u":
    • manufacturer supplies a "standard error," "standard uncertainty" (u), or "combined standard uncertainty" (often denoted as uC ) for the TV
  • Sub scenario "Uk":
    • manufacturer provides an "expanded uncertainty" (U) for the TV and a "coverage factor" (k)
  • Sub scenario "Ucoverage":
    • manufacturer provides an "expanded uncertainty" (U) for the TV and a "coverage percentage"
  • Sub scenario "lowerupper":
    • manufacturer provides an lower and upper limits and a "coverage percentage" (CI)

Example

calculate_bias_interval('A', subscenario = 'Uk', nrun = 7, nrep = 5, SWL = .042, SR = .032, nsamples = 2, exppected_mean = 1, user_mean = .94)

Will return

Error in calculate_se_rm(scenario, additional_args) : For the choosed scenario U and k must be supplied

So we need to pass the requested parameters:

calculate_bias_interval('A', subscenario = 'Uk', nrun = 7, nrep = 5, SWL = .042, SR = .032, nsamples = 2, expected_mean = 1, user_mean = .94, U = 140, k = 1.96)

Scenario B and C

When a reference material's total uncertainty (TV) is determined based on Proficiency Testing (PT) (B) or peer group results from an interlaboratory QC program (C)

Additional parameters necessary are sd_rm and nlab

Example

calculate_bias_interval('C', nrun = 7, nrep = 5, SWL = .042, SR = .032, nsamples = 2, expected_mean = 1, user_mean = .94, sd_rm = .05, nlab = 43)

Scenario D and E

If the TV represents a conventional quantity value (D) or When working with a commercial QC material supplied with a TV for which the standard error cannot be estimated (E)

calculate_bias_interval('E', nrun = 7, nrep = 5, SWL = .042, SR = .032, nsamples = 2, expected_mean = 1, user_mean = .94)

Bias conclusion

If the mean is inside interval object returned in calculate_bias_interval() the result is not significant and the observed bias is inside the manufacture claims

Copy Link

Version

Install

install.packages('CLSIEP15')

Monthly Downloads

157

Version

0.1.0

License

MIT + file LICENSE

Maintainer

Claucio Antonio Rank Filho

Last Published

November 10th, 2023

Functions in CLSIEP15 (0.1.0)

calculate_se_x

Calculate SE x
dfc_references

Reference of degrees of freedon based on tau given in the CLSI Manual
calculate_uvl_info

Calculate upper verification limit
calculate_se_c

Calculate SE combined based on SE X and SE RM
calculate_bias_interval

Calculate bias interval from TV
calculate_m

Calculate M
calculate_n0

Calculate n0
calculate_aov_infos

Calculate ANOVA Results and Imprecision Estimates
bias_validation_interval

Calculate bias validation interval
calculate_dfWL

Calculate degres of freedom within-lab as specified in appendix B
calculate_se_rm

Calculate SE RM given a scenario and a list of additional args that can change based on the selected scenario or sub scenario
calculate_df_combined

Calculate degrees of freedom of SE C (SE combined) given a selected scenario and additional parameters necessary for the scenario
calculate_F_uvl

Calculate the UVL factor
create_table_ep_15

Create table for precision calculations
calculate_se_rm_scenario_d_e

Calculate SE RM for scenario D or E If the TV represents a conventional quantity value or When working with a commercial QC material supplied with a TV for which the standard error cannot be estimated
calculate_se_rm_scenario_b_c

Calculate SE RM for scenario B or C If the reference material has a TV determined by PT or peer group results
calculate_se_rm_a_Ucoverage

Calculate SE RM for scenario A when f the manufacturer supplies an “expanded uncertainty” (abbreviated by uppercase “U”) for the TV and coverage e.g. 95 or 99,
calculate_se_rm_a_Uk

Calculate SE RM for scenario A when f the manufacturer supplies an “expanded uncertainty” (abbreviated by uppercase “U”) for the TV and the “coverage factor” (abbreviated by “k”)
calculate_se_rm_a_lowerupper

Calculate SE RM for scenario A when f the manufacturer supplies lower and upper limits and coverage confidence interval (95 or 99...)
calculate_se_rm_a_u

Calculate SE RM for scenario A when “standard error” or “standard uncertainty” (abbreviated by lowercase “u”) or “combined standard uncertainty” (often denoted by “uC ”)
ferritin_long

Ferrtin data used in CLSI document examples in wide format
ferritin_wider

Ferrtin data used in CLSI document examples in wide format