Top Banner
PROC STANDARD SAS FUNCTIONS SAS OPERATIONS Canicia Smith [email protected] Office hour: Wed 13:00-14:00
21
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: SAS 11/01

PROC STANDARDSAS FUNCTIONSSAS OPERATIONS

Canicia Smith

[email protected]

Office hour: Wed 13:00-14:00

Page 2: SAS 11/01

PROC STANDARD

Page 3: SAS 11/01

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
Page 5: SAS 11/01

Example

New data set

Page 6: SAS 11/01

SAS FUNCTIONS

Page 7: SAS 11/01

SAMPLE STATISTICS

Mean

=Mean(var1, var2)

Sum

=Sum(var1, var2)

Square root

=Sqrt(var)

Round

=round(var, .1)

Page 8: SAS 11/01

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

LOG

• Log

X=log(var);

Page 10: SAS 11/01

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

EXPONENTIAL

• Exponential x=exp(1.0)=2.718

exp (argument)

Page 12: SAS 11/01

SAS OPERATORS

Page 13: SAS 11/01

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

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

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

QUESTIONS~?????

Page 17: SAS 11/01

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

Create a data set to get this output..

Page 19: SAS 11/01

Proc meansWhat statement would produce the following output?

Page 20: SAS 11/01

What statements do you need to produce the second output?

Page 21: SAS 11/01

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.