Join Jordan Bakerman for an in-depth discussion in this video Using SAS functions, part of SAS Programming for R Users, Part 1.
- [Instructor] In this section,…I want to show you to use some built-in SAS functions…to assist in creating new variables,…functions like sum, absolute,…exponentiate, round, and so forth,…and we'll use all these in a data step…to create our new variables.…And by the end of this section,…I want to show you how to create…your own user-defined function…to be used inside of a data step.…So here I have a function called mydivision in R…with two arguments, numerator and denominator.…I want to be able to return a value of zero…if the denominator is zero.…
Otherwise, I just want to return the value…numerator divided by denominator.…So to create a new variable using built-in SAS function,…we'll do it the exact same way in R.…Here we'll use it in our data step.…We have our data statement, our set statement,…and here I'm creating a variable called log_price…which I'm just setting equal to the log of msrp,…meaning I'm just taking the log of every element…in that variable.…Now, most of these functions operate the exact same way…
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.