| 
  | 
    
	 
	  
	  Generated by ChatGPT 
	Overview
	
	Objectives
	
		- Identify adjustment set for removing confounding prevalent in 
		observational data
 
		- Stratification of adjustment sets
 
		- Use of inverse propensity weights to remove treatment selection bias
 
	 
	Assigned Reading & Learning Material
	
		- 
		Understanding confounding in observational data
		
 
		- Propensity Score with Inverse Probability Weights
		
		
 
		- Selecting the right predictors
		Slides►
		YouTube►
 
	 
	Instruction for Submission of Assignments: Submission 
	should follow these rules: 
	
		- Include a statement from your project manager that the work was done 
		on time and accurately.
 
		- Submit your answers in a Jupyter Notebook
		Download►
		YouTube►
		Slides► 
 
		- 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: 
	
		- 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.
 
		- 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. 
 
		 
  
		- 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►
  
		- 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►)
		
			- 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.
 
			- Replace any predict value with 1, if the variable is included in 
			the history.csv file.  See a sample file containing 60 
			regressions for predicting the variables that affect response to 
			Venlafaxine
			
			Download Excel►
 
			- 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.  
   
		 
		 
		- 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."
  
		- 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►
 
		 
		 
	 
	  
	
 |