Learn R Programming

Agreement (version 0.8-1)

agreement: Assessment of Agreement

Description

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.

Value

An object of class report is returned, which contains all the estimated statistics and their confidence limits.

Details

The functions summary and plot can be used to print a summary of the results and plot the observations.

References

Lawrence Lin, A. S Hedayat, Bikas Sinha, Min Yang. Journal of the American Statistical Association. March 1, 2002, 97(457): 257-270.

See Also

summary.agreement, summary.report, plot.report, html.report

Examples

Run this code
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);
plot(agr);

Run the code above in your browser using DataLab