Compute the concordance correlation coefficient (CCC), precision, accuracy, total deviation index (TDI), coverage probability (CP) and relative biased square (RBS) for the paired observations (test and target) based on the model proposed by Lin, Hedayat, Sinha and Yang (2002).
Usage
agreement(x, y, error, target, CCC_a = 0.95, TDI_a, alpha = 0.05, CP_a = 0.9, H_label = "x", V_label = "y", min = NA, max = NA, by = NA, dec = 2)
Arguments
x
A vector of the readings for the target assay or rater, it will be shown in the horizontal axis of the agreement plot
y
A vector of the readings for the test assay or rater, it will be shown in the vertical axis of the agreement plot
error
Constant or proportional error structure. Use error="const" if the error structure is constant. Then, TDI is expressed as an absolute difference with the same measurement unit as the original data. Use error="prop" if the error structure is proportional, Then, TDI is expressed as a percent change. The natural log transformation to the data will be applied.
target
target="random" or "fixed".
CCC_a
A CCC allowance, the default if CCC_a=0.95.
TDI_a
A TDI allowance which must be specified for computing CP, must be a percent value when error="prop" is specified or an absolute difference when error="const" is specified.
alpha
100(1-alpha)
CP_a
A CP allowance which must be specified for computing TDI. The default is CP_a=0.9.
H_label
Label for the horizontal axis (target) of the agreement plot. The default is H_label="x".
V_label
Label for the vertical axis (test) of the agreement plot. The default is V_label="y".
min
Minimum of the plotting range, if it is not specified, a range will be chosen automatically to show all the data point.
max
Maximum of the plotting range, if it is not specified, a range will be chosen automatically to show all the data point.
by
The increment of the plotting range. If error="const" is specified, it is the value of increment, for example, by=5. If error="prop" is specified, it is the log scale increments in between min and max. For example, if min=1 and max=64, then by=c(2,4,8,16,32). If by is not specified, it will be chosen automatically based on the error structure.
dec
Significant digits for the output. The default is dec=2.
Details
The functions summary and plot can be used to print a summary of the results and plot the observations.
Value
An object of class report is returned, which contains all the estimated statistics and their confidence limits.
Author(s)
Yue Yu <yyu@imyy.net>
References
Lawrence Lin, A. S Hedayat, Bikas Sinha, Min Yang. Journal of the American Statistical Association. March 1, 2002, 97(457): 257-270.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Agreement)
Loading required package: R2HTML
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Agreement/agreement.Rd_%03d_medium.png", width=480, height=480)
> ### Name: agreement
> ### Title: Assessment of Agreement
> ### Aliases: agreement
>
> ### ** Examples
>
> data(DCLHb);
> HemocueAve <- apply(DCLHb[,c("HEMOCUE1","HEMOCUE2")],1,mean);
> SigmaAve <- apply(DCLHb[,c("SIGMA1","SIGMA2")],1,mean);
>
> agr=agreement(y=HemocueAve,x=SigmaAve,V_label="Hemacue",H_label="Sigma",min=0,max=2000,by=250,CCC_a=0.9775,CP_a=0.9,TDI_a=150,error="const",target="random",dec=3,alpha=0.05);
> summary(agr);
Agreement Statistics
CCC Precision Accuracy TDI CP RBS
0.9866 0.9867 0.9999 127.487 0.9463 0
95% Confidence Limits
CCC Precision Accuracy TDI CP RBS
0.9838 0.9839 0.9989 136.388 0.9276 .
Allowance
CCC Precision Accuracy TDI CP RBS
0.9775 . . 150 0.9 .
> plot(agr);
>
>
>
>
>
> dev.off()
null device
1
>