Skip to content
Snippets Groups Projects
Yin Xi's avatar
Yin Xi authored
6074fe7d
Name Last commit Last update
README.md
iei.R

Interchangeability

code for calculating the individual equivalence index (IEI) by Nancy Obuchowski

this repo contains the read-to-use r code link for paper

brief reminder of interchangeability

measure the "difference in variation" between

  • varition of repeated measurements on the reference method vs
  • variation between new method and reference method

requirements

single reader

one reader read all reference method at least twice and new method at least once

multi reader

at least two readers read all reference method at least once and at least two readers read all new method at least once.

readers who read the new and reference methods can be same or different persons.

in multi reader situation, only inter-reader variation were considered, that's why we need to make sure at least 2 readers for reference and new method respectively.

how to run code

  1. download the r script "iei.r"
  2. in r
source("PATH_TO_iei.r")

iei(data = mydata, type = 'c', boot_ci = T) #for continuous measurement

#or

iei(data = mydata, type = 'b', boot_ci = T) #for binary or categorical measurement

there are only two parameters other than the input data

  1. type: either 'c'/'continuous' (gee with gaussian distrubtion) or 'b'/'binary' (gee with logistic). when 'c'/'continuous' is specified, the mean squared difference is used. when 'b'/'binary' is specified, the percent agreement is used.
  2. boot_ci: True or False. whether to calculate the 95% confidence interval for the individual equivalence index using bootstrap method or not. boot.ci function with type = "bca" is used.

note that in the binary case, IEI is defined as the ==difference== between percent agreement of TvsR and percent agreement of RvsR. However, when using logistic regression, only the standard error of the difference in log odds is directly estimable not the standard error of the difference in probabilities. So currently only bootstrap method is available to calculate 95% CI of IEI. There should be a Taylor approximiation availabe as the next step.

note that squared difference is likely not normally distributed. therefore the 95% CI from GEE may not be reliable anyway. there is a potential study comparing coverage probabilities between GEE and bootstrap.

requirement on dataset

the dataset should be in long format with the following exact columns

SID: subject id, numerical or characters as long as uniquely identifies individual subjects RID: reader id, numerical number only, should uniquely identify each individual reader MID: method id, either "T" (new test) or "R" (reference). val: the actual measurement, numeric only

repeated measurements from the same reader on the same subject using the same method can be recorded as multiple rows with the same SID, RID and MID and different val. (i.e. there is no need to specify session ID) The algorithm automatically detect and adjust for intra-reader repeated reads.

values

$Mean_squared_differences or $Mean_agreement: mean squared differences for RvsR and TvsR respectively (For continuous measurement) and percent agreement for RvsR and TvsR respectively (For binary/categorical measurement)

$IEI: individual equivalence index, 95% CI from GEE (using robust sandwitch estimator) when continuous

$bootCI: bootstrap 95% CI if boot_ci=T.

$mod: the gee model.

$paired_data: reorgnized data on difference that was fed into the gee

$raw_data: the input data with two additional columns; SeID (auto-generated session id), RMSeID (unique id corresponds to subscript in the paper)