/* Lesson 13-02 */ /* File Name = les1302.sas 01/18/22 */ options nocenter linesize=78 pagesize=30; options locale='en_US'; /* options locale='ja_JP'; */ proc printto print = 'StatM21/les1302-Results.txt' new; data gakusei; infile 'StatM21/StudAll21d.csv' firstobs=9 dlm=',' dsd missover encoding=sjis termstr=crlf; input sex $ shintyou taijyuu kyoui jitaku : $10. kodukai carryer $ tsuuwa; /* if shintyou="." or taijyuu="." or kyoui="." then delete; */ if carryer="DoCoMo" then carryer="docomo"; if carryer="DoCoMo+w" then carryer="docomo+W"; if carryer="vodafone" then carryer="Vodafone"; if carryer="au+willc" then carryer="au+Willc"; proc print data=gakusei(obs=5); run; title '*** 通常の頻度集計、クロス集計(アルファベット順になる) ***'; proc freq data=gakusei; tables sex jitaku carryer; run; proc freq data=gakusei; tables sex*jitaku; tables sex*carryer; tables jitaku*carryer; run; title '*** 頻度の大きい順に表示 ***'; proc freq data=gakusei order=freq; tables sex jitaku carryer; run; proc freq data=gakusei order=freq; tables sex*jitaku; tables sex*carryer; tables jitaku*carryer; run; title '*** 頻度の大きい順に表示(頻度のみ) ***'; proc freq data=gakusei order=freq; tables sex jitaku carryer / nopercent norow nocol; run; proc freq data=gakusei order=freq; tables sex*jitaku / nopercent norow nocol; tables sex*carryer / nopercent norow nocol; tables jitaku*carryer / nopercent norow nocol; run;