HAP 786: Workshop in Health Informatics

Lecture: Actionable AI Advice 

 
  Home  
 

Remove Confounding
Generated by ChatGPT

Overview

Objectives

  1. Identify adjustment set for removing confounding prevalent in observational data
  2. Stratification of adjustment sets
  3. Use of inverse propensity weights to remove treatment selection bias

Assigned Reading & Learning Material

  1. Understanding confounding in observational data
  2. Propensity Score with Inverse Probability Weights
  3. Selecting the right predictors Slides► YouTube►

Assignment

Instruction for Submission of Assignments: Submission should follow these rules:

  1. Include a statement from your project manager that the work was done on time and accurately.
  2. Submit your answers in a Jupyter Notebook Download► YouTube► Slides►
  3. Submit you answers in Canvas.

Task 1: The overall task is to use output from ChatGPT to prepare feedback to the patient.  You are asked to complete this task using the following steps:

  1. This file is obtained from medical history intake.  For the time being create a simulated file containing the medical history of one patient. Name this file history.csv.
  2. Most of the variables needed for predicting response to antidepressants have one to one relationships with conditions, medications, or procedures mentioned in history.csv file. The exceptions are the following variables that are calculated from the entries in the history.csv file: 
    • ADRM_4DN standing for history of use of an antidepressant different from the response variable and no remission. Calculate this variable from reported remission status and agreement between last antidepressant used and the response variable in the model used for predicting response to a specific antidepressant. For each predictive model, the response variable is different and if the response variable and the history of intake agree, then it is considered same and otherwise it is considered different.  
    • ADRM_3DR standing for history of use of an antidepressant different from the response variable and remission. Calculate this variable as described above.
    • ADRM_2SN standing for history of use of an antidepressant same as the response variable and no remission. Calculate this variable as described above.
    • ADRM_1SR standing for history of use of an antidepressant same as the response variable and remission. Calculate this variable as described above.
    • nepi_2+ standing for more than 2 of episodes of depression in previous year.  This variable is based on number of depression episodes 2-months apart reported by the client.
    • nadep_23 standing for 2 or 3 prior antidepressants tried. This variable is based on count of the previous antidepressants reported by the client.
    • nadep_4 standing for 4 prior antidepressants tried.  This variable is based on count of the previous antidepressants reported by the client.
     
  3. Download the file describing regression coefficients predicting response to 15 antidepressants and adjustments for missing values. This file contains the response variable in the regression in the first column, code for the predictors, text describing the predictor, and coefficients for the predictors (including intercept) are in subsequent columns.  This file is being updated by others in class. Download Excel►
  4. Write code to analyze the data to predict the probability of response to various antidepressant for a client (Vlad Cardenas's advice on how to do this in Excel YouTube►)
    1. The coefficient file contains many regressions.  The first column lists the response variable in the regression. In the first step, predict the predictors of response to antidepressants.  These are response variables that are not an antidepressant but either a condition, procedure, or medication used in predicting response to antidepressants.  Independent variables in these regressions are assumed to be absent (i.e., zero), if the independent variable is not in the history.csv, and is not predicted by one of the regressions.  Otherwise, if the independent variable is in history.csv then assign a probability of 1 to it; if it is predicted by other variables, then assign it the calculated probability from the regression.  The probability of a response variable is calculated as 1/(1+e-R), where R is the sum of the product of the variable and the coefficient of the variable.
    2. Replace any predict value with 1, if the variable is included in the history.csv file. 
    3. Predict probability of response to antidepressant using 1/(1+e-R), where R is the sum of the product of (a) the probability of presence of the predictor of the antidepressant and (b) the coefficient of the predictor in coefficient.xlsx. 
  5. Provide a summary of client's relevant medical history using the following text:  "We are assuming that you have major depressive disorder. If you do not, our advice is not appropriate for you. If you have bipolar disorder, our advice is not appropriate for you.  Among the variables you mentioned during the medical history intake, the following are relevant in selection of appropriate antidepressants:  Provide a bullet list of short text for the variables mentioned in history.csv."
  6. Provide advice:
    • Give a plot of likelihood of responses to different antidepressants. 
    • Indicate recommended antidepressant.  If all antidepressants have less than 0.10 probability of response say: "In our data, we could not find an antidepressant that works well for patients with your characteristics.  All 15 antidepressants we examined have less than 10 percent chance of success for a patient with your characteristics. Your primary care provider might be able to make a more informed advice.  In addition, it may be appropriate to look for other options besides oral antidepressants for treatment of depression."  If a recommendation is appropriate:  Provide the name of the antidepressant with highest response rate and provide the response rate.  If other antidepressants are within 5% of the recommended antidepressant, add the second antidepressants to recommendations.  Mention to "take this information to your primary care provider and discuss if there is a need for change in your medications.  Do not change your medications suddenly as abrupt changes in antidepressants could be dangerous." 
    • Provide a link to PubMed for more information on recommended antidepressant (see examples already created for the 15 antidepressants at web site)
    • Give reasons supporting the advice (see examples already created for the 15 antidepressants)  Prototype Advice►

 

 

 

Farrokh Alemi, Ph.D. Most recent revision 09/20/2024.  This page is part of the course on Workshop in Health Informatics