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 exposure

Generating exposure - R Tutorial

From the course: Descriptive Healthcare Analytics in R

Start my 1-month free trial

Generating exposure

- [Instructor] I will show you how to generate the exposure variables we will be using in this analysis. First, we will go to our exposure, alcohol. We'll start by generating the grouping variable, and then we will continue by generating the indicator variables. One for drink monthly and one for drink weekly. If you open the data dictionary, you will see that these are the names of the calculated variables we are preparing. I'll show them to you in the data dictionary, but I'll summarize them here. We are making a grouping variable for alcohol, and indicator variables for drinking monthly and drinking weekly. Next, we are cleaning up the sleep time variable by removing rows coded as 77 or 99. Now this is just an academic exercise in this data set, since we already excluded them. But I just wanted to show you how to do it. Finally, we make a binary asthma variable. But again, we excluded all the unknowns so this is just a demonstration. Okay, now let's go to our data dictionary and…

Contents