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 - R Tutorial
From the course: Descriptive Healthcare Analytics in R
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Reading in BRFSS XPT data6m 57s
-
(Locked)
Naming conventions5m 38s
-
(Locked)
Keeping native variables5m 15s
-
(Locked)
Applying the first exclusion6m 3s
-
(Locked)
Applying the rest of the exclusions4m 57s
-
(Locked)
Operations in code3m 52s
-
(Locked)
Making a data reduction diagram4m 35s
-
(Locked)
Generating exposure4m 43s
-
(Locked)
Generating outcome variables3m 32s
-
-
-
-
-