From the course: SAS Essential Training: 1 Descriptive Analysis for Healthcare Research

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Solution: Make a categorical variable from a continuous one

Solution: Make a categorical variable from a continuous one - SAS Tutorial

From the course: SAS Essential Training: 1 Descriptive Analysis for Healthcare Research

Solution: Make a categorical variable from a continuous one

(upbeat music) - [Narrator] Okay, here is my solution. My solution code starts here. So let me highlight and run all the code before it. So it puts us on the results tab, but let's go back to the code. Okay, remember, our assignment was to create a new variable called BPGRP, that would be a categorical variable, based on the continuous variable, BPXOSY1, which is systolic blood pressure. We'd code it according to the categories of hypertension status from the AHA I listed on the slide when I was introducing the challenge. Here's my data step. I created the variable BPGRP, and I decided to code missing or unknown as nine. So I started with populating every record with a nine. Then below that, I tell SaaS to update the record with a new code if it fits the criteria. The first one says if the source variable is less than 120 and is not equal to missing, then set BPGRP to one. You need to add in the and not equal to missing because SAS has a weird sort order that sorts missing before the…

Contents