SlideShare ist ein Scribd-Unternehmen logo
1 von 27
SAS tutorial 10/25
Overview
• PROC SUMMARY
• PROC SORT

• LABEL
• GOTO
SUMMARY & SORT
PROC SUMMARY
• Provides data summarization tools that
  compute descriptive statistics for variables
  across all observations or within groups of
  observations.
• Similar to PROC MEANS
Syntax
Differences to MEANS
• Cannot do t-test
• Cannot calculate confidence limits
• Cannot estimate quantiles
Example 1
DATA creativity
Result
Use “BY” option
“Not sorted in ascending
       sequence”
PROC SORT
• Orders SAS data set observations by the
  values of one or more character or numeric
  variables
Syntax
Example 2
Result
Example 1
Result
LABEL & GOTO
GOTO
• Directs program execution immediately to the
  statement label that is specified and, if
  followed by a RETURN statement, returns
  execution to the beginning of the DATA step.
(Statement) Label
• Specifies a statement label that identifies the
  GOTO destination. The destination must be
  within the same DATA step. You must specify
  the label argument.
Example 3
• DATA info;                • DATA info;
  Input X Y;                  Input X Y;
  If 1<=X<=5 then             If X<1 or X>5 then do;
  go to OK;                       X=3; count+1;
      X=3; count+1;           end;
  OK:SUMX+X;                  SUMX+X;
  Cards;                      Cards;
               X1     X1’   SUMX

               1      1       1

               2      2       3

               6      3       6

               4      4      10

               7      3      13

               1      1      14
Result
Return
• DATA info;                         • DATA info;
  Input X Y;                           Input X Y;
  If 1<=X<=5 then go to                If X<1 or X>5 then do;
  OK;
                                           X=3; count+1;
      X=3; count+1;
                                       End;
  Return;
                                       else SUMX+X;
  OK:SUMX+X;
  Cards;        X1        X1’   SUMX   Cards;
                1         1      1

                2         2      3

                6         3      3

                4         4      7

                7         3      7

                1         1      8
Result

Weitere ähnliche Inhalte

Andere mochten auch

2014 All That Jazz Invitation - Guest Email Blast - Copy
2014 All That Jazz Invitation - Guest Email Blast - Copy2014 All That Jazz Invitation - Guest Email Blast - Copy
2014 All That Jazz Invitation - Guest Email Blast - CopyKevin J. Box
 
δεντρα
δεντρα δεντρα
δεντρα GIA VER
 
Drogas alcohol treball
Drogas alcohol treballDrogas alcohol treball
Drogas alcohol treballpepitaj41
 
Como subir un buscador google al blog
Como subir un buscador google al blogComo subir un buscador google al blog
Como subir un buscador google al bloggreciasantelices15
 
LUXURY High Performance Kitchens FINAL
LUXURY High Performance Kitchens FINALLUXURY High Performance Kitchens FINAL
LUXURY High Performance Kitchens FINALLinda Passaro
 
20170110 presentatie waterschap
20170110 presentatie waterschap20170110 presentatie waterschap
20170110 presentatie waterschapWilliam Nederpelt
 

Andere mochten auch (9)

2014 All That Jazz Invitation - Guest Email Blast - Copy
2014 All That Jazz Invitation - Guest Email Blast - Copy2014 All That Jazz Invitation - Guest Email Blast - Copy
2014 All That Jazz Invitation - Guest Email Blast - Copy
 
δεντρα
δεντρα δεντρα
δεντρα
 
Drogas alcohol treball
Drogas alcohol treballDrogas alcohol treball
Drogas alcohol treball
 
Como subir un buscador google al blog
Como subir un buscador google al blogComo subir un buscador google al blog
Como subir un buscador google al blog
 
LUXURY High Performance Kitchens FINAL
LUXURY High Performance Kitchens FINALLUXURY High Performance Kitchens FINAL
LUXURY High Performance Kitchens FINAL
 
Investigacion de Mercado
Investigacion de MercadoInvestigacion de Mercado
Investigacion de Mercado
 
20170110 presentatie waterschap
20170110 presentatie waterschap20170110 presentatie waterschap
20170110 presentatie waterschap
 
02 angles
02 angles02 angles
02 angles
 
Las empresas según el sector económico
Las empresas según el sector económicoLas empresas según el sector económico
Las empresas según el sector económico
 

Mehr von Kai Chun Cheng

Photo social network compare
Photo social network comparePhoto social network compare
Photo social network compareKai Chun Cheng
 
Social website research
Social website researchSocial website research
Social website researchKai Chun Cheng
 
Contextual user research handout part 2
Contextual user research handout part 2Contextual user research handout part 2
Contextual user research handout part 2Kai Chun Cheng
 

Mehr von Kai Chun Cheng (7)

Photo social network compare
Photo social network comparePhoto social network compare
Photo social network compare
 
Social website research
Social website researchSocial website research
Social website research
 
Sas 教學 2012 12-20
Sas 教學 2012 12-20Sas 教學 2012 12-20
Sas 教學 2012 12-20
 
SAS 2012-11-22 array
SAS 2012-11-22 arraySAS 2012-11-22 array
SAS 2012-11-22 array
 
2012-11-22 sas
2012-11-22 sas2012-11-22 sas
2012-11-22 sas
 
1025 sas實習課
1025 sas實習課1025 sas實習課
1025 sas實習課
 
Contextual user research handout part 2
Contextual user research handout part 2Contextual user research handout part 2
Contextual user research handout part 2
 

1025 sas實習課