File Exchange

image thumbnail

Clarke Error Grid Analysis

version 1.9 (27.1 KB) by

Clarke EGA quantifies the accuracy of glucose estimates generated by meters as compared to reference

16 Downloads

Updated

View License

The Clarke error grid approach is used to assess the clinical significance of differences between the glucose measurement technique under test and the venous blood glucose reference measurements. The method uses a Cartesian diagram, in which the values predicted by the technique under test are displayed on the y-axis, whereas the values received from the reference method are displayed on the x-axis. The diagonal represents the perfect agreement between the two, whereas the points below and above the line indicate, respectively, overestimation and underestimation of the actual values. Zone A (acceptable) represents the glucose values that deviate from the reference values by ±20% or are in the hypoglycemic range (<70 mg/dl), when the reference is also within the hypoglycemic range. The values within this range are clinically exact and are thus characterized by correct clinical treatment. Zone B (benign errors) is located above and below zone A; this zone represents those values that deviate from the reference values, which are incremented by 20. The values that fall within zones A and B are clinically acceptable, whereas the values included in areas C-E are potentially dangerous, and there is a possibility of making clinically significant mistakes. [1-4]

Syntax:

[total, percentage] = clarke(y,yp)

Inputs:
y = reference values (mg/dl)
yp = predicted/estimtated values (mg/dl)

Outputs:
total = total points per zone:
total(1) = zone A,
total(2) = zone B, and so on

percentage = percentage of data which fell in certain region:
percentage(1) = zone A,
percentage(2) = zone B, and so on.

Example:
load example_data.mat
[tot, per] = clarke(y,yp)

References:
[1] A. Maran et al., “Continuous subcutaneous glucose monitoring in diabetic patients: a multicenter analysis,” Diabetes Care, vol. 25, no. 2, pp. 347–352, Feb. 2002.
[2] B. P. Kovatchev et al. “Evaluating the accuracy of continuous glucose-monitoring sensors: continuous glucose-error grid analysis illustrated by TheraSense Freestyle Navigator data,” Diabetes Care, vol. 27, no. 8, pp. 1922–1928, Aug. 2004.
[3] E. Guevara and F. J. Gonzalez, “Prediction of Glucose Concentration by Impedance Phase Measurements,” in MEDICAL PHYSICS: Tenth Mexican Symposium on Medical Physics, Mexico City (Mexico), 2008, vol. 1032, pp. 259–261.
[4] E. Guevara and F. J. Gonzalez, “Joint optical-electrical technique for noninvasive glucose monitoring,” REVISTA MEXICANA DE FISICA, vol. 56, no. 5, pp. 430–434, Sep. 2010.

© Edgar Guevara Codina
codina@REMOVETHIScactus.iico.uaslp.mx
File Version 1.2
March 29 2013

Ver. 1.2 Statistics verified, fixed some errors in the display; thanks to Tim Ruchti from Hospira Inc. for the corrections
Ver. 1.1 corrected upper B-C boundary, lower B-C boundary slope ok; thanks to Steven Keith from BD Technologies for the corrections!
MATLAB ver. 7.10.0.499 (R2010a)

Comments and Ratings (15)

Edgar Guevara

Edgar Guevara (view profile)

Dear @Sarul Gupta,

1) It is meant for DM2 patients
2) I do not know

Sarul Gupta

Hii,

Thank you for this interesting code.
Can you please clarify whether this Clarke EGA is for Type 1 or Type 2 diabetes (you may refer : Technical Aspects of the Parkes Error Grid).
Secondly, Is this plot is in accordance with the latest POCT guideline ( You may refer this paper: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4523734/)?

Waiting for your response:)

Edgar Guevara

Edgar Guevara (view profile)

Dear Duha,

It is customary as sign of good netiquette, to post the solution / answer, so everyone can benefit from this. I suppose you entered vectors as the input parameters.

Duha A.Azim

I figured it out :)
Thank you

Duha A.Azim

First of all, THANK YOU so much!

Could anyone please tell me how I can plot several values on the same figure? I tried the hold command but it still generated a new figure..

Example:
[tot, per] = clarke(82,83);
Hold
[tot,per] = clarke(70,98);

molecule77

thanks for your help!!

Wei

Wei (view profile)

excellent!

Edgar Guevara

Edgar Guevara (view profile)

@Jan Simon: Thanks for the kind words!

Jan Simon

Jan Simon (view profile)

The purpose of this function is not my field of science, therefore I cannot rate the actual calculations. But this code appeared in discussion and I'm impressed by the clean and complete help section.

Edgar Guevara

Edgar Guevara (view profile)

Ver. 1.2 Statistics verified, fixed some errors in the display; thanks to Tim Ruchti from Hospira Inc. for the corrections

Peter

Peter (view profile)

Thank you for the interesting code! However, I suspect that there is an inconsistency in the interpretation of zone A and B. The totals and the plots are not compatible e.g. zoom in on clarke(200,243) and clarke(200, 160).

Peter Jacobs

Thank you very much for the useful code. Well done!

Edgar Guevara

Edgar Guevara (view profile)

Steven,

First of all, thank you for the suggestions, I think I might have made some mistakes on the regions boundaries, since I measured all boundaries from a printed plot (on the referred articles) so nothing was very exact. I hope you could provide me with the original work from Clarke, to make the necessary corrections.

Steven Keith

Overall, the logic is excellent. There are 2 suggestions: for the lower C region, the slope of the boundary should be 7/5 rather than 6/5. For the upper B-C boundary, there are two schools of though displayed in error grids being published. I think Clarke still uses a line parallel to 45deg rather than a line parallel to the +20% line. Very nice code.

Guillermo Quintas

A really useful job!.

Updates

1.9

Ver. 1.2 Statistics verified, fixed some errors in the display; thanks to Tim Ruchti from Hospira Inc. for the corrections

1.8

Ver. 1.2 Statistics verified, fixed some errors in the display; thanks to Tim Ruchti from Hospira Inc. for the corrections.

1.2

Added some more references

1.1

Ver. 1.1 corrected upper B-C boundary, lower B-C boundary slope ok, thanks to Steven Keith from BD Technologies for the corrections!

MATLAB Release
MATLAB 7.10 (R2010a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today