Title: | Single Reader Between-Cases AUC Estimator in Nested Data |
Version: | 1.0 |
Description: | This R package provides a calculation of between-cases AUC estimate, corresponding covariance, and variance estimate in the nested data problem. Also, the package has the function to simulate the nested data. The calculated between-cases AUC estimate is used to evaluate the reader's diagnostic performance in clinical tasks with nested data. For more details on the above methods, please refer to the paper by H Du, S Wen, Y Guo, F Jin, BD Gallas (2022) <doi:10.1177/09622802221111539>. |
License: | CC0 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.2.1 |
Imports: | magrittr, dplyr, mvtnorm, iMRMC, Rcpp |
LinkingTo: | Rcpp |
Depends: | R (≥ 3.5.0) |
NeedsCompilation: | yes |
Packaged: | 2022-10-21 01:19:20 UTC; duson |
Author: | Hongfei Du |
Maintainer: | Hongfei Du <hongfei@gwmail.gwu.edu> |
Repository: | CRAN |
Date/Publication: | 2022-10-21 15:07:51 UTC |
Function for calculating 2 reader AUC covariance
Description
Function for calculating 2 reader AUC covariance
Usage
AUC_cov_2reader_nest(success_score)
Arguments
success_score |
The success score for nested data |
Value
the covariance between two readers' AUC
MRMC analysis in nested data problem
Description
This function takes nested data as a data frame and runs a multi-reader multi-case analysis for single reader in nested data problem based on modified U-statistics as described in the following paper:
Usage
AUC_per_reader_nest(data)
Arguments
data |
The nested data for analysis. This dataset should have specified columns: "patient","reader1","reader2","reader3","reader4","reader5","truth","mod","region". |
Value
This function returns a list containing three dataframes.
Here is a quick summary: AUC_per_reader [data.frame] this data frame contains the AUC estimates for each reader under different modalities (Mod1 denotes modality 1 and Mod2 denotes modality 2). AUC_Var_per_reader [data.frame] this data frame contains the AUC variance estimates for each reader under different modalities. numROI [data.frame] this data frame contains the number of positive and negative ROIs in each case.
Examples
data = NestMRMC::expected_data
Outputs = AUC_per_reader_nest(data)
covariance 8th moment middle calculation part one
Description
covariance 8th moment middle calculation part one
Usage
cov_m8_f1(m)
Arguments
m |
input matrix |
Value
the middle values for calculating covariance 8th moment
covariance 8th moment middle calculation part two
Description
covariance 8th moment middle calculation part two
Usage
cov_m8_f2(m)
Arguments
m |
input matrix |
Value
the middle values for calculating covariance 8th moment
Simulation function
Description
Simulation function
Usage
data_MRMC(sim.config)
Arguments
sim.config |
list contains following parameters: I num The number of patients. k num The number of ROIs in each patient. R num The number of readers. correlation_t num The correlation for simulating truth label. potential_correlation_s num The correlation for simulating reading scores. AUC_all num The theoretical AUC values. sameclustersize boolean The binary variable to decide whether we have same number of ROIs in each patient. rho num The scale parameter that infulence the covariance matrix in multivariate normal distribution. fix_design boolean Binary variable to decide whether fix the truth label in simulation. stream num The integer control the random number generator. |
Value
A list and the only element in the list is the simulated data with following columns: "clusterID","unitID","reader1",...,"truth"
Delete diagonal term function
Description
Delete diagonal term function
Usage
delete_diag(m)
Arguments
m |
the input matrix for deleting diagonal term |
Value
diagonal term removed matrix
The test demo data to be included in my package
Description
The test demo data to be included in my package
Author(s)
Hongfei Du hongfei@gwu.edu
function for calculating the 11th moment
Description
function for calculating the 11th moment
Usage
m11_f(m)
Arguments
m |
input matrix |
Value
the 11th moment
function for calculating the 8th moment
Description
function for calculating the 8th moment
Usage
m8_f(m)
Arguments
m |
input matrix |
Value
the 8th moment
Configuration function
Description
Configuration function
Usage
simu_config(
I = 100,
k = 10,
R = 2,
correlation_t = 0,
potential_correlation_s = rep(0.5, 4),
AUC_all = rep(0.7, 2),
sameclustersize = TRUE,
rho = 0.5,
fix_design = FALSE,
stream = 20220210,
initial_seed = 20220222
)
Arguments
I |
The number of patients. |
k |
The number of ROIs in each patient. |
R |
The number of readers. |
correlation_t |
The correlation for simulating truth label. |
potential_correlation_s |
The correlation for simulating reading scores. |
AUC_all |
The theoretical AUC values. |
sameclustersize |
The binary variable to decide whether we have same number of ROIs in each patient. |
rho |
The scale parameter that influence the covariance matrix in multivariate normal distribution. |
fix_design |
Binary variable to decide whether fix the truth label in simulation. |
stream |
The integer control the random number generator. |
initial_seed |
The integer control the random seed for truth label generation. |
Value
A list of above parameters
Calculate the success score
Description
Calculate the success score
Usage
success_score(data)
Arguments
data |
the nested MRMC data |
Value
The success score and number of ROIs in each case
sum the diagonal terms
Description
sum the diagonal terms
Usage
sum_diag(m)
Arguments
m |
input matrix |
Value
sum of diagonal terms
Calculate the between-cases AUC estimator's theoretical variance and covariance
Description
This function calculates between-cases AUC estimator's theoretical variance and covariance based on all the truths, namely, the ROI's truth labels, AUC values, covariance between ROI scores within same reader, scale factor that influences the covariance between ROI scores between readers and the variances for positive and negative ROI scores. Detailed formulas are available in following paper: Single Reader Between-Cases AUC Estimator with Nested Data. Statistical Methods in Medical Research. https://doi.org/10.1177/09622802221111539. There is also a Rcpp version of this function in this package. The function name is 'true_AUC_var_abitrary_Rcpp', which is much faster than current version. They produce the exact same results.
Usage
true_AUC_var_abitrary(
numROI,
AUC = 0.7,
cov = 0.5,
rho = 0.5,
sigma_pos = 1,
sigma_neg = 1
)
Arguments
numROI |
The number of positive and negative ROIs in all the patients. |
AUC |
The AUC values used in simulated data. |
cov |
The covariance used in simulating reading scores. |
rho |
The scale factor used in simulating reading scores. |
sigma_pos |
The variacne for positive ROI's reading score, defalut is 1. |
sigma_neg |
The variacne for negative ROI's reading score, defalut is 1. |
Value
The theoretical AUC estimator's (co)variance based on the simulation settings.
Calculate the between-cases AUC estimator's theoretical variance and covariance
Description
This function calculates between-cases AUC estimator's theoretical variance and covariance based on all the truths, namely, the ROI's truth labels, AUC values, covariance between ROI scores within same reader, scale factor that influences the covariance between ROI scores between readers and the variances for positive and negative ROI scores. Detailed formulas are available in following paper: Single Reader Between-Cases AUC Estimator with Nested Data. Statistical Methods in Medical Research. https://doi.org/10.1177/09622802221111539. There is also a none Rcpp version of this function in this package. The function name is 'true_AUC_var_abitrary', which is slower but no need to install Rcpp. They produce the exact same results.
Usage
true_AUC_var_abitrary_Rcpp(
numROI,
AUC = 0.7,
cov = 0.5,
rho = 0.5,
sigma_pos = 1,
sigma_neg = 1
)
Arguments
numROI |
The number of positive and negative ROIs in all the patients. |
AUC |
The AUC values used in simulated data. |
cov |
The covariance used in simulating reading scores. |
rho |
The scale factor used in simulating reading scores. |
sigma_pos |
The variacne for positive ROI's reading score, defalut is 1. |
sigma_neg |
The variacne for negative ROI's reading score, defalut is 1. |
Value
The theoretical AUC estimator's (co)variance based on the simulation settings.
Calculate the each moments coefficient in variance
Description
Calculate the each moments coefficient in variance
Usage
var_coef(numROI)
Arguments
numROI |
number of ROIs in each case |
Value
all the coefficients