Introduction


This vignette shows the general purpose and usage of the mcradds R package.

mcradds is a successor of the mcr R package that is developed by Roche, and therefore the fundamental coding ideas for method comparison regression have been borrowed from it. In addition, I supplement a series of useful functions and methods based on several reference documents from CLSI and NMPA guidance. You can perform the statistical analysis and graphics in different IVD trials utilizing these analytical functions.

browseVignettes(package = "mcradds")

However, unfortunately these functions and methods have not been validated and QC’ed, I can not guarantee that all of them are entirely proper and error-free. But I always strive to compare the results to other resources in order to obtain a consistent for them. And because some of them were utilized in my past routine workflow, so I believe the quality of this package is temporarily sufficient to use.

In this vignette you are going to learn how to:

  • Estimate of sample size for trials, following NMPA guideline.
  • Evaluate diagnostic accuracy with/without reference, following CLSI EP12-A2.
  • Perform regression methods analysis and plots, following CLSI EP09-A3.
  • Perform bland-Altman analysis and plots, following CLSI EP09-A3.
  • Detect outliers with 4E method from CLSI EP09-A2 and ESD from CLSI EP09-A3.
  • Estimate bias in medical decision level, following CLSI EP09-A3.
  • Perform Pearson and Spearman correlation analysis adding hypothesis test and confidence interval.
  • Evaluate Reference Range/Interval, following CLSI EP28-A3 and NMPA guideline.
  • Add paired ROC/AUC test for superiority and non-inferiority trials, following CLSI EP05-A3/EP15-A3.
  • Perform reproducibility analysis (reader precision) for immunohistochemical assays, following CLSI I/LA28-A2 and NMPA guideline.
  • Evaluate precision of quantitative measurements, following CLSI EP05-A3.
  • Descriptive statistics summary.

The reference of mcradds functions is available on the mcradds website functions reference.


Common IVD Trials Analyses

Every above analysis purpose can be achieved by few functions or S4 methods from mcradds package, I will present the general usage below.

The packages used in this vignette are:

library(mcradds)

The data sets with different purposes used in this vignette are:

data("qualData")
data("platelet")
data(creatinine, package = "mcr")
data("calcium")
data("ldlroc")
data("PDL1RP")
data("glucose")
data("adsl_sub")

Estimation of Sample Size

Example 1.1

Suppose that the expected sensitivity criteria of an new assay is 0.9, and the clinical acceptable criteria is 0.85. If we conduct a two-sided normal Z-test at a significance level of α = 0.05 and achieve a power of 80%, the total sample is 363.

size_one_prop(p1 = 0.9, p0 = 0.85, alpha = 0.05, power = 0.8)
#> 
#>  Sample size determination for one Proportion 
#> 
#>  Call: size_one_prop(p1 = 0.9, p0 = 0.85, alpha = 0.05, power = 0.8)
#> 
#>    optimal sample size: n = 363 
#> 
#>    p1:0.9 p0:0.85 alpha:0.05 power:0.8 alternative:two.sided

Example 1.2

Suppose that the expected sensitivity criteria of an new assay is 0.85, and the lower 95% confidence interval of Wilson Score at a significance level of α = 0.05 for criteria is 0.8, the total sample is 246.

size_ci_one_prop(p = 0.85, lr = 0.8, alpha = 0.05, method = "wilson")
#> 
#>  Sample size determination for a Given Lower Confidence Interval 
#> 
#>  Call: size_ci_one_prop(p = 0.85, lr = 0.8, alpha = 0.05, method = "wilson")
#> 
#>    optimal sample size: n = 246 
#> 
#>    p:0.85 lr:0.8 alpha:0.05 interval:c(1, 1e+05) tol:1e-05 alternative:two.sided method:wilson

If we don’t want to use the CI of Wilson Score just following the NMPA’s suggestion in the appendix, the CI of Simple-asymptotic is recommended with the 196 of sample size, as shown below.

size_ci_one_prop(p = 0.85, lr = 0.8, alpha = 0.05, method = "simple-asymptotic")
#> 
#>  Sample size determination for a Given Lower Confidence Interval 
#> 
#>  Call: size_ci_one_prop(p = 0.85, lr = 0.8, alpha = 0.05, method = "simple-asymptotic")
#> 
#>    optimal sample size: n = 196 
#> 
#>    p:0.85 lr:0.8 alpha:0.05 interval:c(1, 1e+05) tol:1e-05 alternative:two.sided method:simple-asymptotic

Example 1.3

Suppose that the expected correlation coefficient between test and reference assays is 0.95, and the clinical acceptable criteria is 0.9. If we conduct an one-sided test at a significance level of α = 0.025 and achieve a power of 80%, the total sample is 64.

size_corr(r1 = 0.95, r0 = 0.9, alpha = 0.025, power = 0.8, alternative = "greater")
#> 
#>  Sample size determination for testing Pearson's Correlation 
#> 
#>  Call: size_corr(r1 = 0.95, r0 = 0.9, alpha = 0.025, power = 0.8, alternative = "greater")