PROC MEANS和PRC FREQ在做描述性分析的时候很常用,用法也比较简单,不过这两个过程步的某些选项容易忘记,本文就梳理一下。
在进入正文前,我们先创建所需的数据集TEST_SCORES:
DATA TEST_SCORES; INPUT COUNTY : $9. SCHOOL & $21. TEACHER : $8. MATH SCIENCE ENGLISH; DATALINES; HUNTERDON FLEMING MIDDLE SCHOOL SMITH 92 95 88 HUNTERDON FLEMING MIDDLE SCHOOL SMITH 94 89 92 HUNTERDON FLEMING MIDDLE SCHOOL SMITH . 82 84 HUNTERDON FLEMING MIDDLE SCHOOL SMITH . . 68 HUNTERDON FLEMING MIDDLE SCHOOL RIVERA 82 89 72 HUNTERDON FLEMING MIDDLE SCHOOL RIVERA 97 94 92 HUNTERDON FLEMING MIDDLE SCHOOL RIVERA . 88 . HUNTERDON ROBERT HUNTER GREGORY 80 82 94 HUNTERDON ROBERT HUNTER GREGORY 82 84 82 HUNTERDON ROBERT HUNTER WRIGHT 60 70 80 HUNTERDON ROBERT HUNTER WRIGHT 62 72 83 MIDDLESEX SAINT BARTS ACADEMY JONES 72 78 77 MIDDLESEX SAINT BARTS ACADEMY JONES 83 83 92 MIDDLESEX SAINT BARTS ACADEMY JONES 91 78 81 MIDDLESEX RUTGERS PREP MAROTTO . 99 . MIDDLESEX RUTGERS PREP MAROTTO 96 98 98 MIDDLESEX RUTGERS PREP MAROTTO 83 88 88 MIDDLESEX RUTGERS PREP MAROTTO 84 86 85 MIDDLESEX RUTGERS PREP MAROTTO 92 97 93 MIDDLESEX RUTGERS PREP FRIEDMAN 99 98 90 MIDDLESEX RUTGERS PREP FRIEDMAN 96 95 90 MIDDLESEX RUTGERS PREP FRIEDMAN 84 85 84 MIDDLESEX RUTGERS PREP PATERSON 68 72 66 MIDDLESEX RUTGERS PREP PATERSON 72 74 68 MIDDLESEX FRANKLIN HIGH PETERS 80 80 92 MIDDLESEX FRANKLIN HIGH PETERS 83 85 88 ;
1. PROC MEANS
1.1 BY和CLASS