SAS 11/01
Transcript of SAS 11/01
![Page 1: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/1.jpg)
PROC STANDARDSAS FUNCTIONSSAS OPERATIONS
Canicia Smith
Office hour: Wed 13:00-14:00
![Page 2: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/2.jpg)
PROC STANDARD
![Page 3: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/3.jpg)
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/HTML/default/viewer.htm#a000146748.htm
![Page 4: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/4.jpg)
![Page 5: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/5.jpg)
Example
New data set
![Page 6: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/6.jpg)
SAS FUNCTIONS
![Page 7: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/7.jpg)
SAMPLE STATISTICS
Mean
=Mean(var1, var2)
Sum
=Sum(var1, var2)
Square root
=Sqrt(var)
Round
=round(var, .1)
![Page 8: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/8.jpg)
SAMPLE STATISTICS (con.)
Maxmax(argument1, argument2)Minmin(argument1, argument2)Mod mod(argument1,argument-2)Eg. 9/3Argument1- the dividend=9Argument2-the divisor=3
![Page 9: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/9.jpg)
LOG
• Log
X=log(var);
![Page 10: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/10.jpg)
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)
![Page 11: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/11.jpg)
EXPONENTIAL
• Exponential x=exp(1.0)=2.718
exp (argument)
![Page 12: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/12.jpg)
SAS OPERATORS
![Page 13: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/13.jpg)
SAS OPERATORS (ARITHMETIC)
Symbol Definition Example
**raise to a
powera**3
* multiplication 2*y
/ division var/5
+ addition num+3
- subtractionvar1-
var2
![Page 14: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/14.jpg)
SAS OPERATORS (COMPARISON)
Symbo
l
Mnemonic
Equivalent Definition Example
= EQ equal to a=3
^= NE not equal to a ne 3
> GT greater than num>5
< LT less than num<5
>= GEgreater than or equal
tovar>=300
<= LE less than or equal to var<=300
IN IN equal to one of a list num in (3, 4,
5)
![Page 15: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/15.jpg)
SAS OPERATORS (LOGICAL)
Symbol Mnemonic Equivalent Example
& AND (a>b) & (c>d)
/ OR (a>b) / (c>d)
^ NOT not (a>b)
![Page 16: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/16.jpg)
QUESTIONS~?????
![Page 17: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/17.jpg)
Possible Exam questions
Create a data set to give this output.
Which statement should be inserted to produce the group output?
![Page 18: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/18.jpg)
Create a data set to get this output..
![Page 19: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/19.jpg)
Proc meansWhat statement would produce the following output?
![Page 20: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/20.jpg)
What statements do you need to produce the second output?
![Page 21: SAS 11/01](https://reader035.fdocuments.in/reader035/viewer/2022081603/559b6ae61a28ab1d188b46b3/html5/thumbnails/21.jpg)
NamesSubject John Mary DickLucy James
Math 90 80 7874 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
5 students name John (boy), Mary (girl), Dick (boy), Lucy (girl), and James (boy) has the following scores in the following subjects:
1. Write a sas program to output this data.2. Find the mean and sum of each student’s grades.