From: demin on 18 Jun 2010 11:30 Hi, My proc freq output is as below. I just want a simple line plot: percent*fgroup, but by group Gender, and overlay in one plot. But I cann't do this in gplot. Also I've tried plot in proc freq, and only bar plot and dot plot available, and not what i want. Gender fgroup COUNT PERCENT 1 0 1 0.574712644 1 1 6 3.448275862 1 2 10 5.747126437 1 3 58 33.33333333 1 4 99 56.89655172 2 0 2 0.597014925 2 1 18 5.373134328 2 2 54 16.11940299 2 3 159 47.46268657 2 4 102 30.44776119 my code: symbol1 w=2 value=none height=0.5 interpol=join color=blue; symbol2 w=2 value=none height=0.5 interpol=join color=red; axis1 label=(height=1 color=black "Percent(%)") order=(0 to 100 by 25); axis2 label=(height=1 color=black "Group") order=(0 to 4 by 1); legend1 label=none position=(left top inside) across=3 mode=share; proc gplot data=Freqcount; plot PERCENT*fgroup /overlay legend=legend1 vaxis=axis1 haxis=axis2; by Gender; run; quit; It should be a simple way to do this, isn't it? thanks. --iris
From: Ya on 18 Jun 2010 11:33 On Jun 18, 8:30 am, demin <qdmi...(a)gmail.com> wrote: > Hi, My proc freq output is as below. I just want a simple line plot: > percent*fgroup, but by group Gender, and overlay in one plot. But I > cann't do this in gplot. Also I've tried plot in proc freq, and only > bar plot and dot plot available, and not what i want. > Gender fgroup COUNT PERCENT > 1 0 1 0.574712644 > 1 1 6 3.448275862 > 1 2 10 5.747126437 > 1 3 58 33.33333333 > 1 4 99 56.89655172 > 2 0 2 0.597014925 > 2 1 18 5.373134328 > 2 2 54 16.11940299 > 2 3 159 47.46268657 > 2 4 102 30.44776119 > > my code: > symbol1 w=2 value=none height=0.5 interpol=join color=blue; > symbol2 w=2 value=none height=0.5 interpol=join color=red; > axis1 > label=(height=1 color=black "Percent(%)") > order=(0 to 100 by 25); > axis2 > label=(height=1 color=black "Group") > order=(0 to 4 by 1); > legend1 label=none > position=(left top inside) > across=3 > mode=share; > proc gplot data=Freqcount; > plot PERCENT*fgroup /overlay legend=legend1 vaxis=axis1 > haxis=axis2; > by Gender; > run; > quit; > > It should be a simple way to do this, isn't it? thanks. --iris Try this: plot PERCENT*fgroup=gender / legend=legend1 vaxis=axis1; *by gender; /* comment out by gender here */
From: demin on 18 Jun 2010 11:53 On Jun 18, 11:33 am, Ya <huang8...(a)gmail.com> wrote: > On Jun 18, 8:30 am, demin <qdmi...(a)gmail.com> wrote: > > > > > > > Hi, My proc freq output is as below. I just want a simple line plot: > > percent*fgroup, but by group Gender, and overlay in one plot. But I > > cann't do this in gplot. Also I've tried plot in proc freq, and only > > bar plot and dot plot available, and not what i want. > > Gender fgroup COUNT PERCENT > > 1 0 1 0.574712644 > > 1 1 6 3.448275862 > > 1 2 10 5.747126437 > > 1 3 58 33.33333333 > > 1 4 99 56.89655172 > > 2 0 2 0.597014925 > > 2 1 18 5.373134328 > > 2 2 54 16.11940299 > > 2 3 159 47.46268657 > > 2 4 102 30.44776119 > > > my code: > > symbol1 w=2 value=none height=0.5 interpol=join color=blue; > > symbol2 w=2 value=none height=0.5 interpol=join color=red; > > axis1 > > label=(height=1 color=black "Percent(%)") > > order=(0 to 100 by 25); > > axis2 > > label=(height=1 color=black "Group") > > order=(0 to 4 by 1); > > legend1 label=none > > position=(left top inside) > > across=3 > > mode=share; > > proc gplot data=Freqcount; > > plot PERCENT*fgroup /overlay legend=legend1 vaxis=axis1 > > haxis=axis2; > > by Gender; > > run; > > quit; > > > It should be a simple way to do this, isn't it? thanks. --iris > > Try this: > > plot PERCENT*fgroup=gender / legend=legend1 vaxis=axis1; > *by gender; /* comment out by gender here */- Hide quoted text - > > - Show quoted text - Thanks Ya, it works.
|
Pages: 1 Prev: How can I remove the "" Next: Categorical Data Analysis Using SAS, Seminar July 12-16 |