View source: R/calculate_igi30.R
calculate_igi30 | R Documentation |
This function calculates theInsulinogenic Index using glucose and insulin sampled during a standard 75g oral glucose tolerance test.
calculate_igi30(
time,
glucose,
insulin,
time_units = "min",
glucose_units = "mg/dl",
insulin_units = "uU/ml"
)
calculate_igi60(
time,
glucose,
insulin,
time_units = "min",
glucose_units = "mg/dl",
insulin_units = "uU/ml"
)
time |
a column name (unquoted) indicating time values (in minutes) |
glucose |
a column name (unquoted) storing glucose values (in mg/dL) |
insulin |
a column name (unquoted) storing insulin values (in uU/mL) |
time_units |
if units are not in "min", can indicate here for unit conversion (options "min" or "hr") |
glucose_units |
if units are not in "mg/dl", can indicate here for unit conversion (options "mg/dl" or "mmol/l") |
insulin_units |
if units are not in "uU/ml", can indicate here for unit conversion (options "uU/ml" or "pmol/l") |
Standard timepoints are 0, 30, 60, 90, and 120 min. Note: insulin unit conversion may differ differ depending on assay. Insulin (pmol/l) = insulin (uU/ml)*6
'calculate_igi30()' accepts 3 separate vectors for time, glucose, insulin.
Uses the formula detailed in Seltzer et al:
\frac{(Insulin_{30} - Insulin_0)}{(Glucose_{30}-Glucose_0)}
Insulinogenic index as a single value
# individual objects for each item
time=c(0, 30, 60, 90, 120) # minutes
glucose=c(93, 129, 178, 164, 97) # mg/dL
insulin=c(12.8, 30.7, 68.5, 74.1, 44.0) # uU/mL
calculate_igi30(time, glucose, insulin) # 8.95
# handling data stored in a dataframe
ogtt1 <- data.frame(time=c(0, 30, 60, 90, 120), # minutes
glucose=c(93, 129, 178, 164, 97), # mg/dL
insulin=c(12.8, 30.7, 68.5, 74.1, 44.0)) # uU/mL
calculate_igi30(ogtt1$time, ogtt1$glucose, ogtt1$insulin) # 8.95
calculate_igi60(ogtt1$time, ogtt1$glucose, ogtt1$insulin) # 11.79529
# Convert units
ogtt5 <- data.frame(time = c(0,0.5,1,1.5,2), # time in hours
glucose = c(5.167, 7.167, 9.889, 9.111, 5.3889), # glucose in mmol/l
insulin = c(76.8,184.2,411,444.6,264)) # insulin in pmol/l
calculate_igi30(time = ogtt5$time,
glucose = ogtt5$glucose,
insulin = ogtt5$insulin,
time_units = "hr", insulin_units = "pmol/l", glucose_units = "mmol/l")
calculate_igi60(time = ogtt5$time,
glucose = ogtt5$glucose,
insulin = ogtt5$insulin,
time_units = "hr", insulin_units = "pmol/l", glucose_units = "mmol/l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.