The Simple Guide to SAS®: From Null to Novice (for True Epub) by Kirby Thomas

The Simple Guide to SAS®: From Null to Novice (for True Epub) by Kirby Thomas

Author:Kirby Thomas
Language: eng
Format: epub
Publisher: SAS Institute Inc.


Country

City

Miles

Transportation

Usa

Philadelphia

4,117

Fly

Usa

Boston

3,837

Fly

Germany

Munich

1

Walk

Germany

Berlin

363

Drive

Kyrgyzstan

Bishkek

4,200

Fly

Italy

Rome

587

Drive

Austria

Vienna

270

Drive

Remember that you can use all the operators listed in the Filtering section above when creating your conditional logic rules.

6.5 Manipulating Values

SAS has hundreds of functions that enable you to perform calculations on numeric and date values or manipulate character values11. When appropriate, functions can be used to turn character values into numeric and numeric values into character. Functions start with the function name (e.g., UPCASE) followed by a set of required and optional arguments separated by commas and enclosed in parentheses. Functions can be used on a single, specified numeric or character value or applied to all values in a column when you list a variable name as one of your arguments.

Functions are often used when creating new variables based on calculations or manipulations done to one or more original variables in the data set. An example of this would be creating a new variable called Name by taking the uppercase values of a field called Full_Name. If the first observation in your data set has a Full_Name value of “Amy Conner”, the new Name column would display “AMY CONNER”. Functions are also frequently used in conditional logic. For example, you could use the MISSING function to say that if a value for the variable Income is missing, it should be replaced with the median Income value for the data set.

Functions can also be stacked. This means that you can have a function within a function. The resolved value of the inner function is used as an argument in the outer function. This comes in handy when you need to convert a character variable to numeric before you perform a calculation on the values of that variable. It can also be used to round the calculation results, as you will see in the Manipulating Values section.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.