Join Jordan Bakerman for an in-depth discussion in this video Conditionally creating variables with a DO group, part of SAS Programming for R Users, Part 1.
- [Instructor] In the previous examples…when I was using my if, else if, and else statements,…we only executed a single statement…after the keyword then.…Well, what if I want to create multiple variables,…meaning I have to execute multiple statements.…I need to go ahead and use a SAS DO group.…And the SAS DO group is very common going forward.…In this series, we'll see it when we do matrix simulation…and we want to execute something conditionally.…So, it's a great piece of syntax…to keep in your back pocket.…
So, how do we use the DO group?…Well, we begin the same way,…if, specify our expression,…then we use the keyword do followed by a semicolon.…And then, we execute whatever statements we want…to create as many variables as we want.…And remember, always end your DO groups…with the end statement.…And the same goes for the else if…and else statements as well.…So, to practice using the DO group,…let's motivate again with an example.…So, now, suppose car manufacturers receive…an economic incentive for manufacturing cars…
Note: You can visit the SAS site to obtain a copy of the software, and use the company's online data sets to do the course exercises.
- SAS University Edition
- Working in SAS Studio
- Using tasks and snippets in SAS Studio
- Determining power using simulation
- SAS procedure syntax
- Creating datasets manually in the DATA step
- Importing raw data files
- Creating new variables and conditional processing
- Match-merging data sets
Skill Level Beginner
Descriptive Healthcare Analytics in Rwith Monika Wahi4h 15m Advanced
1. Introduction and Working in SAS
2. Importing and Reporting Data
3. Creating New Variables, Functions, and Data Tables
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.