PROC STANDARD
   SAS FUNCTIONS
   SAS OPERATIONS
        Canicia Smith
  caniciasmith@gmail.com
Office hour: Wed 13:00-14:00
PROC STANDARD
What does proc standard do?
1. It standardizes variables in a data set to a
given mean and standard deviation.
2. It creates a new data set containing the
standardized values




http://support.sas.com/documentation/cdl/en/proc/61895/HTM
L/default/viewer.htm#a000146748.htm
Example




New data set
SAS FUNCTIONS
SAMPLE STATISTICS
Mean
=Mean(var1, var2)
Sum
=Sum(var1, var2)
Square root
=Sqrt(var)
Round
=round(var, .1)
SAMPLE STATISTICS (con.)
Max
max(argument1, argument2)
Min
min(argument1, argument2)
Mod
mod(argument1,argument-2)
Eg. 9/3
Argument1- the dividend=9
Argument2-the divisor=3
LOG
• Log
X=log(var);
PROBABILITY
Ex. Poisson probability distribution
cdf (‘POISSON’, n, m)
N is an integer random variable (range: n=0,1, ..)
M is a numeric mean parameter (range: m>0)
EXPONENTIAL
• Exponential x=exp(1.0)=2.718
exp (argument)
SAS OPERATORS
SAS OPERATORS (ARITHMETIC)

Symbol     Definition     Example
         raise to a
  **                       a**3
         power
  *      multiplication     2*y
  /      division          var/5
  +      addition         num+3
                           var1-
  -      subtraction
                           var2
SAS OPERATORS (COMPARISON)
Symbo    Mnemonic
                          Definition          Example
l        Equivalent
  =         EQ        equal to                  a=3
 ^=         NE        not equal to             a ne 3
  >         GT        greater than             num>5
  <         LT        less than                num<5
                      greater than or equal
 >=         GE                                var>=300
                      to
 <=         LE        less than or equal to   var<=300
                                             num in (3, 4,
 IN          IN       equal to one of a list
                                                 5)
SAS OPERATORS (LOGICAL)

Symbol    Mnemonic Equivalent    Example
   &             AND            (a>b) & (c>d)

   /              OR            (a>b) / (c>d)

   ^             NOT              not (a>b)
QUESTIONS~?????
Possible Exam questions
         Create a data set to give this output.
    Which statement should be inserted to
    produce the group output?
Create a data set to get this output..
Proc means
     What statement would produce
     the following output?
What statements do you need to produce the second
output?
5 students name John (boy), Mary (girl), Dick (boy),
Lucy (girl), and James (boy) has the following scores in
the following subjects:
                      Names
Subject   John   Mary Dick Lucy   James
Math      90     80   78   74     70
English   96     60   78   50     74
French    87     87   56   78     95
Physics 45       65   34   77     73
History 77       66   88   56     89




1. Write a sas program to output this data.
2. Find the mean and sum of each student’s grades.

SAS 11/01