CSULB_STAT475_handout15

CSULB_STAT475_handout15 - STAT 475 Chapter 14 TRANSFORMING...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
STAT 475 Chapter 14 TRANSFORMING DATA WITH SAS FUNCTIONS SAS FUNCTIONS THAT COMPUTE DESCRIPTIVE STATISTICS Function Syntax Computes for non- missing values SUM MEAN MIN MAX VAR STD sum( argument_1,…,argument_n ) mean( argument_1,…,argument_n ) min( argument_1,…,argument_n ) max( argument_1,…,argument_n ) var( argument_1,…,argument_n ) std( argument_1,…,argument_n ) sum average minimum value maximum value variance standard deviation Note that arguments must be separated by commas: sum(x, y, z). If arguments differ only in ending numbers, then they may be separated by a hyphen. The word OF must precede the list: sum(of x1-x3). If OF is omitted, then sum(x1-x3) computes x1 minus x3 . Example. The following data set contains student id number and scores on quizzes 1 through 5. For each student, the average, minimum, maximum, and standard deviation of scores are computed. data quizzes; input id$ quiz1-quiz5; avg_quiz=mean(quiz1, quiz2, quiz3, quiz4, quiz5); min_quiz=min(of quiz1-quiz5); max_quiz=max(of quiz1-quiz5); std_quiz=std (of quiz1-quiz5); cards; 0495 94 97 95 94 100 8612 89 92 82 97 100 6236 94 89 85 91 94 ; proc print noobs; run; The output is id quiz1 quiz2 quiz3 quiz4 quiz5 avg_quiz min_quiz max_quiz std_quiz 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
495 94 97 95 94 100 96.0 94 100 2.54951 8612 89 92 82 97 100 92.0 82 100 7.03562 6236 94 89 85 91 94 90.6 85 94 3.78153 MANIPULATING SAS DATE VALUES WITH FUNCTIONS
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/14/2011 for the course STAT 475 taught by Professor Olgak during the Fall '11 term at CSU Long Beach.

Page1 / 6

CSULB_STAT475_handout15 - STAT 475 Chapter 14 TRANSFORMING...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online