게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
SAS 코드 중에서 질문좀할게요 ㅠ
게시물ID : science_17258짧은주소 복사하기
작성자 : 젖절한승리
추천 : 0
조회수 : 615회
댓글수 : 1개
등록시간 : 2013/02/26 09:40:40



data aa;

libname Hn11_24R  'D:\SAS\HN11_24RC';

set Hn11_24R.Hn11_24RC(keep=id age n_fcode3 nf_intk3);

if age<=2 then age_g=1;

else if age<=6 then age_g=2;

else if age<=12 then age_g=3;

else if age<=19 then age_g=4;

else if age<=29 then age_g=5;

else if age<=49 then age_g=6;

else if age<=64 then age_g=7;

else age_g=8;

run;


proc sql;

create table aa01 as

select distinct id, age, age_g

from aa

order by id

;

create table aa02 as

select distinct id, count(id) as cnt, age, age_g, sum(nf_intk3) as nf_intk3_s

from aa

where N_fcode3 in ('11031')

group by id

order by id

;

create table aa03 as

select a.id, a.age, a.age_g, nf_intk3_s

from aa01 a full join aa02 b on a.id=b.id

;

quit;


data aa03, set aa03, if nf_intk3_s=. then nf_intk3_s=0 run;


options ls=150;

proc means data=aa02 n mean std max min p95 p99; class age_g; var nf_intk3_s; run;

proc means data=aa03 n mean std max min p95 p99; class age_g; var nf_intk3_s; run;

options;


이렇게 하면, 표가 나오는데

age_g   관측지수   N   평균   표준편차   최대값   최소값   95%   99%  


이렇게 변수가 떠요.

그런데 빨갛게 지정돈 부분이 로그에서 

"구문오류, 다음에 나열된 것들이 요구됩니다. 이름, 따옴표로 둘러싸인 문자열, (, /, ;, _DATA_, _LAST_, _NULL_.)
구문오류로 인하여 문장을 무시합니다."

이렇게 뜹니다... 이게 뭐가 문제가 있을까요.


그리고 원시자료파일에서 위의 코드대로 실행하면 N 값이 1개 차이가 나네요.
원시자료에서 만약 시료코드 10000 의 N 수는 10개인데,
결과 출력된 값에서는 age_g 의 변수 중 N 의 총합이 9개에요... 이유가 뭘까요... ㅠㅠ


통계 프로그램을 사용해 본적이 없는데 원시자료를 이용해서 원하는 자료를 뽑다보니.. SAS까지 손을대게 되네요 ㅠㅠ 
도와주세요 ㅠㅠ

전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호