Search the site...

SASCRUNCH TRAINING
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
Variable Attributes [5-17]
(Sample)



Attribute #3: Variable Type (Numeric)
Picture

​There are only 2 types of variable in SAS: 
  • Numeric
  • Character


Numeric Variable

Numeric variable is used when you have numeric data such as:
  • Age
  • Dollar Amount
  • Date
Picture

The 3 variables from the data set are all numeric variables.
Picture
Note: the results above are from Proc Contents.

No text is allowed

Numeric variable does not allow any character or text values. 

Why?

You often need to compute summary statistics such as mean, standard deviation or median on numeric variables.

Having a character value (such as "unknown", "abc") in a numeric variable will prevent the statistics to be computed.
Picture

Missing Value

You can't avoid having missing value(s) when dealing with data.

When there is a missing value, the numeric variable will show a dot (.) in the data set.

Example
Picture

Important Note

Missing value means that there is no information available in that particular field.

It does NOT equal zero (0).
Picture

A Note on Date Values

Handling the date values in SAS requires special attention. This will be explained in details later this module. 


Summary of Numeric Variable
  • Numeric variable is used when working with numeric values such as age, dollar amount or date
  • No text or character value is allowed in a numeric variable
  • Missing value is represented by a dot in a numeric variable
  • Handling the date values (numeric value) requires special attention. This will be explained in later sessions of this module.

Exercise

Which of the following values are best kept under a numeric variable?


(a) 1234
(b) $12,345
(c) 2015-01-01
(d) .
(e) all of the above
Next

Need some help? 


HINT:
Any values that can be used in any summary statistics calculation should be kept under a numeric variable.


SOLUTION:
(e).
Please note that (b) and (c) include character values (i.e. dollar sign ($), comma (,) and dash (-)). Handling this kind of data will be explained in later sessions.


Fill out my online form.
Already a member? Go to member's area.