- Load in the HELP data set
- Patients with a mental component score (mcs) less than 20 are thought to be at extreme risk of returning to the detoxification unit within the next 12 months. Make a new variable called “ExtremeMCS” and code it as 1 if a patient is at risk based on his/her mcs score and 0 otherwise.
- Make a new variable “SuicidalThought” based off of the variable g1b. Have 1 indicate a patient has had suicidal thoughts and a 0 indicate he/she has not.
- Make a new variable “HomelessStatus” based off of the variable “homeless”. Have a 1 indicate that a patient is homeless and a 0 indicate he/she is housed.
- Suppose we want to assess the overall risk a patient has to return to the detoxification unit and it is believed “ExtremeMCS”, “SuicidalThought”, and “HomelessStatus” are considered risk factors. Construct a new variable called ‘RiskTotal’ which computes the number of risk factors a particular patient has. That is, make it a sum of these 3 variables.
- Make a frequency table of ‘ExtremeMCS’, ‘SuicidalThought’, ‘RiskTotal’ and answer questions 1-3 below.
Question 1: How many patients are thought to be at risk based on his/her mcs score?
Question 2: What percentage of patients have experienced suicidal thoughts? (round your answer to nearest percentage)
Question 3: What percentage of patients in the study have fewer than 3 risk factors. (round your answer to nearest percentage)
Submit your answers in moodle under Mini-Assignment 3.