NAG FL Interface
g04gaf (icc)
1
Purpose
g04gaf calculates the intraclass correlation (ICC).
2
Specification
Fortran Interface
Subroutine g04gaf ( |
mtype, rtype, nrep, nsubj, nrater, score, mscore, smiss, alpha, icc, lci, uci, fstat, df1, df2, pvalue, ifail) |
Integer, Intent (In) |
:: |
mtype, rtype, nrep, nsubj, nrater, mscore |
Integer, Intent (Inout) |
:: |
ifail |
Real (Kind=nag_wp), Intent (In) |
:: |
score(nrep,nsubj,nrater), smiss, alpha |
Real (Kind=nag_wp), Intent (Out) |
:: |
icc, lci, uci, fstat, df1, df2, pvalue |
|
C Header Interface
#include <nag.h>
void |
g04gaf_ (const Integer *mtype, const Integer *rtype, const Integer *nrep, const Integer *nsubj, const Integer *nrater, const double score[], const Integer *mscore, const double *smiss, const double *alpha, double *icc, double *lci, double *uci, double *fstat, double *df1, double *df2, double *pvalue, Integer *ifail) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
g04gaf_ (const Integer &mtype, const Integer &rtype, const Integer &nrep, const Integer &nsubj, const Integer &nrater, const double score[], const Integer &mscore, const double &smiss, const double &alpha, double &icc, double &lci, double &uci, double &fstat, double &df1, double &df2, double &pvalue, Integer &ifail) |
}
|
The routine may be called by the names g04gaf or nagf_anova_icc.
3
Description
Many scientific investigations involve assigning a value (score) to a number of objects of interest (subjects). In most instances the method used to score the subject will be affected by measurement error which can affect the analysis and interpretation of the data. When the score is based on the subjective opinion of one or more individuals (raters) the measurement error can be high and therefore it is important to be able to assess its magnitude. One way of doing this is to run a reliability study and calculate the intraclass correlation (ICC).
In a typical reliability study each of a random sample of
subjects are scored, independently, by
raters. Each rater scores the same subject
times (i.e., there are
replicate scores). The scores,
, for
,
and
can be arranged into
data tables, with the
rows of the table, labelled
, corresponding to the subjects and the
columns of the table, labelled
, to the raters. For example the following data, taken from
Shrout and Fleiss (1979), shows a typical situation where four raters (
) have scored six subjects (
) once, i.e., there has been no replication (
).
| Rater |
Subject | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
The term intraclass correlation is a general one and can mean either a measure of interrater reliability, i.e., a measure of how similar the raters are, or intrarater reliability, i.e., a measure of how consistent each rater is.
There are a numerous different versions of the ICC, six of which can be calculated using
g04gaf. The different versions of the ICC can lead to different conclusions when applied to the same data, it is therefore essential to choose the most appropriate based on the design of the reliability study and whether inter- or intrarater reliability is of interest. The six measures of the ICC are split into three different types of studies, denoted:
,
and
. This notation ties up with that used by
Shrout and Fleiss (1979). Each class of study results in two forms of the ICC, depending on whether inter- or intrarater reliability is of interest.
3.1
: One-Factor Design
The one-factor designs differ, depending on whether inter- or intrarater reliability is of interest:
3.1.1
Interrater reliability
In a one-factor design to measure interrater reliability, each subject is scored by a different set of raters randomly selected from a larger population of raters. Therefore, even though they use the same set of labels each row of the data table is associated with a different set of raters.
A model of the following form is assumed:
where
is the subject effect and
is the error term, with
and
.
The measure of the interrater reliability,
, is then given by:
where
and
are the estimated values of
and
respectively.
3.1.2
Intrarater reliability
In a one-factor design to measure intrarater reliability, each rater scores a different set of subjects. Therefore, even though they use the same set of labels, each column of the data table is associated with a different set of subjects.
A model of the following form is assumed:
where
is the rater effect and
is the error term, with
and
.
The measure of the intrarater reliability,
, is then given by:
where
and
are the estimated values of
and
respectively.
3.2
: Random Factorial Design
In a random factorial design, each subject is scored by the same set of raters. The set of raters have been randomly selected from a larger population of raters.
A model of the following form is assumed:
where
is the subject effect,
is the rater effect,
is the subject-rater interaction effect and
is the error term, with
,
,
and
.
3.2.1
Interrater reliability
The measure of the interrater reliability,
, is given by:
where
,
,
and
are the estimated values of
,
,
and
respectively.
3.2.2
Intrarater reliability
The measure of the intrarater reliability,
, is given by:
where
,
,
and
are the estimated values of
,
,
and
respectively.
3.3
: Mixed Factorial Design
In a mixed factorial design, each subject is scored by the same set of raters and these are the only raters of interest.
A model of the following form is assumed:
where
is the subject effect,
is the fixed rater effect,
is the subject-rater interaction effect and
is the error term, with
,
,
,
and
.
3.3.1
Interrater reliability
The measure of the interrater reliability,
, is then given by:
where
,
and
are the estimated values of
,
and
respectively.
3.3.2
Intrarater reliability
The measure of the intrarater reliability,
, is then given by:
where
,
and
are the estimated values of
,
and
respectively.
As well as an estimate of the ICC, g04gaf returns an approximate confidence interval for the ICC and an -statistic, , associated degrees of freedom ( and ) and p-value, , for testing that the ICC is zero.
Details on the formula used to calculate the confidence interval,
,
,
,
,
,
and
are given in
Gwet (2014). In the case where there are no missing data these should tie up with the formula presented in
Shrout and Fleiss (1979).
In some circumstances, the formula presented in
Gwet (2014) for calculating
,
,
and
can result in a negative value being calculated. In such instances,
, the offending estimate is set to zero and the calculations continue as normal.
It should be noted that
Shrout and Fleiss (1979) also present methods for calculating the ICC based on average scores, denoted
,
and
. These are not supplied here as multiple replications are allowed (
) hence there is no need to average the scores prior to calculating ICC when using
g04gaf.
4
References
Gwet K L (2014) Handbook of Inter-rater Reliability Fourth Edition Advanced Analytics LLC
Shrout P E and Fleiss J L (1979) Intraclass Correlations: Uses in Assessing Rater Reliability Pyschological Bulletin, Vol 86 2 420–428
5
Arguments
-
1:
– Integer
Input
-
On entry: indicates which model is to be used.
- The reliability study is a one-factor design, .
- The reliability study is a random factorial design, .
- The reliability study is a mixed factorial design, .
Constraint:
, or .
-
2:
– Integer
Input
-
On entry: indicates which type of reliability is required.
- Interrater reliability is required.
- Intrarater reliability is required.
Constraint:
or .
-
3:
– Integer
Input
-
On entry: , the number of replicates.
Constraints:
- if or and , ;
- otherwise .
-
4:
– Integer
Input
-
On entry: , the number of subjects.
Constraint:
.
-
5:
– Integer
Input
-
On entry: , the number of raters.
Constraint:
.
-
6:
– Real (Kind=nag_wp) array
Input
-
On entry: the matrix of scores, with
being the score given to the
th subject by the
th rater in the
th replicate.
If rater
did not rate subject
at replication
, the corresponding element of
score,
, should be set to
smiss.
-
7:
– Integer
Input
-
On entry: indicates how missing scores are handled.
- There are no missing scores.
- Missing scores in score have been set to smiss.
Constraint:
or .
-
8:
– Real (Kind=nag_wp)
Input
-
On entry: the value used to indicate a missing score.
- If , smiss is not referenced and need not be set.
- If , the value used to indicate a missing score.
Care should be taken in the selection of the value used to indicate a missing score.
g04gaf will treat any score in the inclusive range
as missing. Alternatively, a NaN (Not A Number) can be used to indicate missing values, in which case the value of
smiss and any missing values of
score can be set through a call to
x07bbf.
-
9:
– Real (Kind=nag_wp)
Input
-
On entry:
, the significance level used in the construction of the confidence intervals for
icc.
Constraint:
.
-
10:
– Real (Kind=nag_wp)
Output
-
On exit: an estimate of the intraclass correlation to measure either the interrater reliability,
, or intrarater reliability,
, as specified by
mtype and
rtype.
-
11:
– Real (Kind=nag_wp)
Output
-
On exit: an approximate lower limit for the confidence interval for the ICC.
-
12:
– Real (Kind=nag_wp)
Output
-
On exit: an approximate upper limit for the confidence interval for the ICC.
In some circumstances it is possible for the estimate of the intraclass correlation to fall outside the region of the approximate confidence intervals. In these cases g04gaf returns all calculated values, but raises the warning .
-
13:
– Real (Kind=nag_wp)
Output
-
On exit:
, the
-statistic associated with
icc.
-
14:
– Real (Kind=nag_wp)
Output
-
15:
– Real (Kind=nag_wp)
Output
-
On exit: and , the degrees of freedom associated with .
-
16:
– Real (Kind=nag_wp)
Output
-
On exit: , the upper tail probability from an distribution.
-
17:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
or
to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value
or
is recommended. If message printing is undesirable, then the value
is recommended. Otherwise, the value
is recommended.
When the value or is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6
Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Errors or warnings detected by the routine:
-
On entry, .
Constraint: , or .
-
On entry, .
Constraint: or .
-
On entry, .
Constraint: .
-
On entry, .
Constraint: when or and , .
-
On entry, after adjusting for missing data, .
Constraint: .
-
On entry, after adjusting for missing data, .
Constraint: when or and , .
-
On entry, .
Constraint: .
-
On entry, after adjusting for missing data, .
Constraint: .
-
On entry, .
Constraint: .
-
On entry, after adjusting for missing data, .
Constraint: .
-
Unable to calculate the ICC due to a division by zero.
This is often due to degenerate data, for example all scores being the same.
-
On entry, a replicate, subject or rater contained all missing data.
All output quantities have been calculated using the reduced problem size.
-
On entry, .
Constraint: or .
-
On entry, .
Constraint: .
-
On entry,
.
alpha is too close to either zero or one.
This error is unlikely to occur.
-
icc does not fall into the interval
.
All output quantities have been calculated.
-
The estimate of at least one variance component was negative.
Negative estimates were set to zero and all output quantities calculated as documented.
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See
Section 9 in the Introduction to the NAG Library FL Interface for further information.
7
Accuracy
Not applicable.
8
Parallelism and Performance
g04gaf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g04gaf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
None.
10
Example
This example calculates and displays the measure of interrater reliability, , for a one-factor design, . In addition the confidence interval, -statistic, degrees of freedom and p-value are presented.
The data is taken from table 2 of
Shrout and Fleiss (1979), which has four raters scoring six subjects.
10.1
Program Text
10.2
Program Data
10.3
Program Results