data color;
input Region Eyes $ Hair $ Count @@;
label Eyes ='Eye Color'
Hair ='Hair Color'
Region='Geographic Region';
datalines;
1 blue fair 23 1 blue red 7 1 blue medium 24
1 blue dark 11 1 green fair 19 1 green red 7
1 green medium 18 1 green dark 14 1 brown fair 34
1 brown red 5 1 brown medium 41 1 brown dark 40
1 brown black 3 2 blue fair 46 2 blue red 21
2 blue medium 44 2 blue dark 40 2 blue black 6
2 green fair 50 2 green red 31 2 green medium 37
2 green dark 23 2 brown fair 56 2 brown red 42
2 brown medium 53 2 brown dark 54 2 brown black 13
;
run;
proc freq data=color nlevels;
tables region eyes hair ;
run;
看看见过就知道了:
SAS 系统
FREQ PROCEDURE
变量水平数
变量 标签 水平
---------------------------------------
Region Geographic Region 2
Eyes Eye Color 3
Hair Hair Color 5
Geographic Region
累积 累积
Region 频数 百分比 频数 百分比
---------------------------------------------------
1 13 48.15 13 48.15
2 14 51.85 27 100.00
Eye Color
累积 累积
Eyes 频数 百分比 频数 百分比
--------------------------------------------------
blue 9 33.33 9 33.33
brown 10 37.04 19 70.37
green 8 29.63 27 100.00
Hair Color
累积 累积
Hair 频数 百分比 频数 百分比
---------------------------------------------------
black 3 11.11 3 11.11
dark 6 22.22 9 33.33
fair 6 22.22 15 55.56
medium 6 22.22 21 77.78
red 6 22.22 27 100.00