정확하게 문제를 이해하면 100 % 확신 할 수 없지만 해결 방법을 제공하려고 시도했습니다.
이것은 아마도 복잡한 해결책 일 것입니다. 나는 많은 짧은/쉬운 해결책이 있다고 생각합니다. 나는 각 질병에 대한 freqs를 계산, 하나 개의 데이터 세트로 병합하고 gplot로 그릴이이 그래프로 이어질 것입니다 샘플 데이터와
data x;
input HoHTAge HoGDAge AddDAge CelDAge;
datalines;
0 0 32 0
0 0 0 0
12 0 23 0
0 20 0 0
25 0 0 0
0 0 0 0
32 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 35
45 0 0 0
0 0 0 0
0 0 0 0
43 0 0 0
0 23 0 0
0 18 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 12 0 0
30 26 0 0
0 40 46 0
0 0 0 30
57 0 0 0
0 0 0 0
;
run;
proc freq data=x noprint ;
tables HoHTAge/out=a;
run;
proc freq data=x noprint ;
tables HoGDAge/out=b;
run;
proc freq data=x noprint ;
tables AddDAge/out=c;
run;
proc freq data=x noprint ;
tables CelDAge/out=d;
run;
data res (drop =percent count);
merge a (in=a rename=(HoHTAge=age)) b (in=b rename=(HoGDAge=age)) c (in=c rename=(AddDAge=age)) d(in=d rename=(CelDAge=age));
by age;
*if age=0 then count=0; /*if you want to exclude age 0*/
if a then HoHTAge=count; else HoHTAge=0;
if b then HoGDAge=count; else HoGDAge=0;
if c then AddDAge=count; else AddDAge=0;
if d then CelDAge=count; else CelDAge=0;
ruN;
/* Set the graphics environment */
goptions reset=all cback=white border htext=10pt htitle=12pt;
axis1 label=("age");
axis2 label=("Count");
symbol1 interpol=join color=R height=14pt font='Arial' ;
symbol2 interpol=join color=B height=14pt font='Arial';
symbol3 interpol=join color=O height=14pt font='Arial' ;
symbol4 interpol=join color=BL height=14pt font='Arial' ;
legend1 repeat=1 label=none frame;
proc gplot data=res;
plot (HoHTAge HoGDAge AddDAge CelDAge)*age/ overlay legend=legend1 haxis=axis1 vaxis=axis2;
run;
, 나는이 더 잘 보일 것 실제 데이터로 생각 때문에 지금 우리 내가 이해로까지 당신처럼 출력을 원
으로 간단한 대안은 당신이 PROC 주파수의 dotplot를 사용할 수 있지만 다음 그래프 만 점을 구분 한 각 질병에 대해 한 번 더 한 후 연령이 없습니다 긴 해결책 :
ods graphics on;
proc freq data=x ;
tables HoHTAge HoGDAge AddDAge CelDAge/plots=freqplot(type=dot ORIENT = VERTICAL);
run;
이미 몇 가지 코드를 사용해 보셨습니까? – vielmetti
당신은 하나의 변수 내에서 또는 여러 변수들 사이에서 계산 된 빈도가 있습니까? 따라서 32가 1 열에 3 회 나타나면 1 열의 빈도는 1/(열 1의 obs 수) 또는 1/(열 1과 3의 obs 수)가됩니까? – superfluous
freqplot을 사용하면 모든 연령대에 대해 하나의 (점 -) 플롯으로이 작업을 수행 할 수 있습니다. 그러나 모든 연령대의 빈도를 한 줄로 줄이기를 바랍니다. 0을 포함하거나 이전에 제외 할 것인가? 하나의 접근법은 적절한 단계에서 플롯을위한 데이터를 작성한 다음 gplot을 사용하는 것입니다. – kl78