Lecture 5 Sorting, Printing, and Summarizing Your Data

Lecture 5 Sorting, Printing, and Summarizing Your Data - I...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: I OWA S TATE U NIVERSITY Department of Animal Science I OWA S TATE U NIVERSITY Department of Animal Science Sorting, Printing, and Summarizing Your Data (Chapter in the 4 Little SAS Book) Animal Science 500 Lecture No. 5 September 14, 2010 I OWA S TATE U NIVERSITY Department of Animal Science Using a Procedure (PROC) Using the procedure statement is like filling out a form You fill in the blanks Choose from the list of options PROC statement All procedures start with this statement Is followed by the name of the procedure desired (Print, Means, Tabulate, etc.) I OWA S TATE U NIVERSITY Department of Animal Science PROC statements If you have many SAS dataset you are using you can specify which dataset you want the procedure to applied to PROC Contents Data = Pig12; This statement is optional If the data statement is not present the Procedure will be applied to the last data set created (not necessarily used). I OWA S TATE U NIVERSITY Department of Animal Science By statement The by statement is required for only one Procedure, the PROC Sort Obviously if you are sorting your data set you want to sort it by some variable contained in your data. In all other Procedures the by statement is optional. I OWA S TATE U NIVERSITY Department of Animal Science Title and Footnote statements Title prints at the top of your output 10 line limit Footnote prints at the bottom of your output 10 line limit You can place these anywhere you want Applies to the Procedure you are working with so you might want to just include it in this particular section I OWA S TATE U NIVERSITY Department of Animal Science Title and Footnote statements When using the title and footnote statements SAS does not care if you use the single quotes test or the double quotes test as long as you are consistent. Do not mix types of quotes I OWA S TATE U NIVERSITY Department of Animal Science Label statement The default situation in SAS uses the variable names to label your output Can create more descriptive labels Limit up to 256 characters long limit Example Label = DOT date on test ADG = Average Daily Gain; I OWA S TATE U NIVERSITY Department of Animal Science Subsetting in Procedures with the Where Statement The Where statement can be used with almost any PROC statement The Where statement can be used to subset the data much like an If Then statement Advantage for the Where statement The IF Then statement only works in the Data step The Where statement works in both the Data and the Procedure step. I OWA S TATE U NIVERSITY Department of Animal Science Subsetting in Procedures with the Where Statement Examples using the Where statement In the Data step Where Backfat le .50 backfat group =1; Where Backfat ge .50 AND le .75 backfat group =2; Where Backfat ge .75 AND le 1.00 backfat group =3; Else Backfat group =.; Run; Quit; I...
View Full Document

This document was uploaded on 02/14/2012.

Page1 / 36

Lecture 5 Sorting, Printing, and Summarizing Your Data - I...

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

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