Preview:
/* create a function to calculate the bode index in copd */
function bodeIndex(FEV1, mMRC, 6MWT) {
  var bodeIndex = 0;
  if (FEV1 < 50) {
    bodeIndex += 4;
  } else if (FEV1 < 60) {
    bodeIndex += 3;
  } else if (FEV1 < 80) {
    bodeIndex += 2;
  } else if (FEV1 < 90) {
    bodeIndex += 1;
  }
  if (mMRC >= 2) {
    bodeIndex += 4;
  } else if (mMRC == 1) {
    bodeIndex += 3;
  }
  if (6MWT < 350) {
    bodeIndex += 4;
  } else if (6MWT < 450) {
    bodeIndex += 3;
  } else if (6MWT < 550) {
    bodeIndex += 2;
  } else if (6MWT < 650) {
    bodeIndex += 1;
  }
  return bodeIndex;
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter