카테고리 없음

Dummy data set 만들기

고향이안드로메다 2018. 11. 29. 09:30

Ref 1

Ref 2


자동으로 순서만들기

data lab3 ; set lab1 ;  

N = _N_  ;

if trt2 = 0 then N1 = 0;

else if trt2 = 1 then N1 = N-1 ;

else if trt2 = 2 then N1 = N-12 ;

else if trt2 = 99 then N1 =99;

run ;


자동으로 순서만들기 참조 1


data company;
   infile cards dsd
   
input company_code :$12.  sector &$50.
   
cards
AN8068571086,Primary sector   
ANN6748L1027,Machinery, equipment, furniture, recycling
BMG0129K1045,Other services
BMG029951016,Other services
BMG0464B1072,Other services
BMG0692U1099,Other services
BMG100821401,Primary sector
BMG169621056,Food, beverages, tobacco
BMG200452024,Other services
BMG303971060,Other services
;;;;
   run
proc print
   
run
proc summary data=company nway
   
class sector;
   output out=sectorCode(rename=(_level_=SectorCode) drop=_type_ _freq_ index=(sector)) / levels
   
run
data company;
   set company;
   set sectorcode key=sector/unique
   
run
proc print
   
run;