(Specifically, it says that the values should be no wider than three characters, and should have no decimal places.) This is what the beginning of the first page of output should look like: (Note, however, that the variable given in the ID statement will automatically print, regardless of whether or not it is listed in the VAR statement.) Finally, a FORMAT statement specifies that height and weight should print with no decimal point. Because we are only interested in the height and weight of each student, these two variables are specified in the VAR statement. The ID statement specifies that variable StudentID should be printed instead of the observation number. The BY statement specifies that we want to group the printed output by the levels of variable Gender. PROC SORT DATA=sample īecause we want to print observations by gender, we must first sort the data using PROC SORT. Using the sample dataset, let's print the height and weight of each student (rounded to the nearest whole number), grouping them by gender, and use the students' IDs in place of the observation numbers. There are other optional statements available in PROC PRINT see the SAS Help and Documentation guide for their descriptions.Įxample. We cover variable formats and the FORMAT statement in our Informats and Formats tutorial. This can be useful, for example, if your numeric variables normally have 2-3 decimal places, but you to suppress decimal places in the PROC PRINT output.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |