Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- SAS
- DeepLearning
- neural networks
- Reinforcement Learning
- 딥러닝
- 꿈
- 강화학습
- Tutorial
- tensorflow
- 한국어
- 머신러닝
- 매크로
- Andrej Karpathy
- cs231n
- 신경망
- SQL
- TensorFlow Tutorials
- tutorials
- Hvass-Lab
- 세상
- 행복
- 답변
- machine learning
- 사랑
- deep learning
- openai
- 인공지능
- Artificil Intelligence
- 번역
- 질문
Archives
- Today
- Total
Economics & Deeplearning
매크로를 활용한 변수 생성 관련 질문입니다. 본문
고수님들들께 도움을 요청합니다.
매크로를 사용하여
변수들을 일정한 법칙에 따라 곱하여 새로운 변수를 생성하고자 합니다.
데이터셋의 변수가 col1 col2 col3 col4 가 있을때
새로운 변수들은 다음과 같은 법칙에 따라 생성하고자 합니다.
col12=col1*col2 ;
col13=col1*col3 ;
col14=col1*col4 ;
col23=col2*col3 ;
col24=col2*col4 ;
col34=col3*col4 ;
고수님들께서 매크로 코드 작성에 도움을 주시기 바랍니다.
================================================================================
data temp;
input col1 col2 col3 col4;
cards;
1 2 3 4
;
run;
proc contents data=temp out=temp_o noprint;
run;
data _null_;
set temp_o end=eof nobs=cnt;
if eof then call symput('cnt',cnt);
run;
%macro make;
data temp1;
set temp;
%do i=1 %to &cnt;
%do j=1 %to &cnt;
col&i&j = col&i * col&j;
%if &i ne 1 %then %if &i = &j %then drop col&i&j;
;
%if &i ne 1 %then %if &i > &j %then drop col&i&j;
;
%end;
%end;
run;
%mend;
%make;
'SAS > SAS 질문과 답변' 카테고리의 다른 글
안녕하세요. sas base 질문 드립니다. (0) | 2016.02.20 |
---|---|
자료의 열 위치가 다를 경우, input 문을 어떻게 해야 하나요? (0) | 2016.02.20 |
proc freq 관측치 카운트 질문입니다! (0) | 2016.02.20 |
어떤 PROC문인지 해석 좀 부탁드립니다 ㅠㅠ (0) | 2016.02.20 |
변수값을 끌어와서 데이터셋 이름을 바꾸려면 어떻게 할까요? (0) | 2016.02.20 |
Comments