From the course: Descriptive Healthcare Analytics in R

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Generating outcome variables

Generating outcome variables - R Tutorial

From the course: Descriptive Healthcare Analytics in R

Start my 1-month free trial

Generating outcome variables

- [Instructor] We are going to accomplish two main efforts in this movie. First we are going to clean up our outcome variable for sleep duration. Next we will make sure we have binary variable or flag that is valid for our asthma outcome. Let's start by reviewing our data dictionary. We'll look at our data dictionary but I just wanted to give you an overview on the slide. We need to remove the rows with no information on sleep time and we want to turn our asthma variable into an indicator variable with only ones and zeroes. Now we'll go to our data dictionary. Remember our sleep duration variable? I'm going to show you how to code sleep time 2 which eliminates these unknown records. Technically I don't have to show you how to do this with our project since we kicked out the records with unknown variable in sleep time 1 but it's helpful to see how you would do it if we had not done that. This shows we need to get rid of the 77s and the 99s. Let's also look at the asthma tab while we're…

Contents