turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- PROC GCHART

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-13-2008 11:51 PM

Is anyone really familiar with either PROC GCHART or annotating datasets?

I'm trying to create a bar graph with the frequency counts on the inside and unique percentages for each group on the outside. I've successfully made the graph I want in PROC GCHART with the frequencies inside the bars. However I can't get PROC GCHART to pull the right percents--it keeps automatically using the percent of my GROUP variable "House_Age" when really I want the percent of my SUMVAR "Frequency". Is it possible to change which variable GCHART uses to calculate percents or do I need to find a way to do this manually with an annotate statement?

Here is my code:

proc gchart data=WORK.&DIRECTORY.;

vbar &RESULT. / DISCRETE GROUP=HOUSE_AGE

PATTERNID=MIDPOINT

type=sum

sumvar=Frequency

inside=sum

outside=pct

maxis=axis1

raxis=axis2

run;

QUIT;

Any advice will be warmly received!

Thanks a million,

Katie

I'm trying to create a bar graph with the frequency counts on the inside and unique percentages for each group on the outside. I've successfully made the graph I want in PROC GCHART with the frequencies inside the bars. However I can't get PROC GCHART to pull the right percents--it keeps automatically using the percent of my GROUP variable "House_Age" when really I want the percent of my SUMVAR "Frequency". Is it possible to change which variable GCHART uses to calculate percents or do I need to find a way to do this manually with an annotate statement?

Here is my code:

proc gchart data=WORK.&DIRECTORY.;

vbar &RESULT. / DISCRETE GROUP=HOUSE_AGE

PATTERNID=MIDPOINT

type=sum

sumvar=Frequency

inside=sum

outside=pct

maxis=axis1

raxis=axis2

run;

QUIT;

Any advice will be warmly received!

Thanks a million,

Katie

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-14-2008 02:43 PM

Possibly this SAS GCHART DOC link (and excerpt) may help:

http://support.sas.com/documentation/cdl/en/graphref/59607/HTML/default/gchart-bar.htm

With subgroups, PERCENT displays the percent contribution of each subgroup to the midpoint value of the bar, based on frequency. The PERCENT values for each subgroup total the percent contribution of the bar to the whole. For example, if the percent contribution of the whole bar is 60%, the PERCENT statistic for all the subgroups in that bar are 60% total. To calculate PERCENT based on the SUMVAR= variable, use the FREQ= and TYPE= options.

Scott Barry

SBBWorks, Inc.

http://support.sas.com/documentation/cdl/en/graphref/59607/HTML/default/gchart-bar.htm

With subgroups, PERCENT displays the percent contribution of each subgroup to the midpoint value of the bar, based on frequency. The PERCENT values for each subgroup total the percent contribution of the bar to the whole. For example, if the percent contribution of the whole bar is 60%, the PERCENT statistic for all the subgroups in that bar are 60% total. To calculate PERCENT based on the SUMVAR= variable, use the FREQ= and TYPE= options.

Scott Barry

SBBWorks, Inc.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-01-2008 05:04 AM

Hi Katie,

I guess this might be the answer, once u use subgroup option in Var statement...........sub group and frequency variable

Syntax:subgroup variable name

I guess this might be the answer, once u use subgroup option in Var statement...........sub group and frequency variable

Syntax:subgroup variable name