통계프로그램 비교 시리즈 – [데이터 관리] 2. 조건문에 의한 변환
[데이터 관리] 2. 조건문에 의한 변수 변환 후 신규 변수 생성하기 1. Proc SQL SAS Programming options ls=150; proc sql; select case when q4=5 then 1 else 0 end as x1, ifn(q4=5,1,0) as x11, case when q4>=4 then 1 else 0 end as x2, ifn(q4>=4,1,0) as x22, case when workshop=1 and q4>=5 then 1 else 0 end as x3, ifn(workshop=1 and q4>=5,1,0) as x33, case when gender='f' then 2*q1+q2 else 3*q1+q2 end as scoreA, ifn(gender='f',2..
2022. 1. 7.
통계프로그램 비교 시리즈 – [데이터 관리] 1. 변수 변환
[데이터 관리] 1. 변수 변환하여 신규 변수 생성하기 1. Proc SQL SAS Programming options linesize=150; proc sql; create table withmooc as select *, q1+q2+q3+q4 as totalq, sum(q1,q2,q3,q4) as totalq1, log10(q1+q2+q3+q4) as logtot, (q1+q2+q3+q4)/4 as mean1, mean(q1,q2,q3,q4) as mean2 from BACK.mydata; select * from withmooc; quit; Results id workshop gender q1 q2 q3 q4 totalq totalq1 logtot mean1 mean2 ----------------..
2022. 1. 7.