Programming the statistical procedures from SAS

Proc gchart and the data behind the graph..Please help Thank you

Reply
Frequent Contributor
Posts: 95

Proc gchart and the data behind the graph..Please help Thank you

Hi,

I would like to copy the data behind the graph (the graph was generated by proc gchart). I can see the data, but I would like

To copy the data and it doesn’t seem that there is a copy option . Please see Pdf attached.

Many Thanks

proc gchart

data=EMWS19.Ids_DATA gout=WORK.PlotGRAPH IMAGEMAP=report;

*;

title "score";

vbar score /

name = "score" description = "score"

FREQ

type=FREQ

noframe

missing

raxis=axis1 maxis=axis2;

run;

quit;

title;

goptions display;

Esteemed Advisor
Esteemed Advisor
Posts: 6,989

Re: Proc gchart and the data behind the graph..Please help Thank you

Hi,

Not sure what software that was for the PDF, however you must have the raw data there as

EMWS19.Ids_DATA

Can you not just run a proc freq on that?

Frequent Contributor
Posts: 95

Re: Proc gchart and the data behind the graph..Please help Thank you

The proc freq won't show me how the graph is been built, basically I want to see for each bar what's the frequency (in a table), you can double clik on the graph and see the data that has helped to create the graph but I can't copy it...basiccaly, the data will be smaller, the number of rows will be equal to the number of bars (for example 50 bars) and ecah bar will have a frequency (Volume) ...Hope I make sense...Thank you

Esteemed Advisor
Esteemed Advisor
Posts: 6,989

Re: Proc gchart and the data behind the graph..Please help Thank you

What software are you using for the graph?

proc sql;

     create table want as

     select     distinct

                    SCORE,

                    COUNT(1) as FREQ

     from        EMWS19.Ids_DATA

     group by SCORE;

quit;

Should be all you need to get frequency per score.

Frequent Contributor
Posts: 95

Re: Proc gchart and the data behind the graph..Please help Thank you

That's not what I want...I am using SAS and have run the code below...the graph is giving me a histogramm but the data used behind this histogramm
has been binned ...so I want to see how SAS has binned it..Proc freq and the slq won't give me the data behind the histogramm!! Could you please run this code, you will get a graph, and if you copy in excel and double click there is a data options, the data can be edited but you can't copy it!

proc gchart

data=EMWS19.Ids_DATA gout=WORK.PlotGRAPH IMAGEMAP=report;

*;

title "score";

vbar score /

name = "score" description = "score"

FREQ

type=FREQ

noframe

missing

raxis=axis1 maxis=axis2;

run;

quit;

title;

goptions display

Occasional Contributor
Posts: 7

Re: Proc gchart and the data behind the graph..Please help Thank you

You could look at the HISTOGRAM statement in PROC UNIVARIATE. Using the OUTHISTOGRAM= generates a dataset with the midpoints, counts and percentages. I would think that SAS uses the same algorithm for histogram construction here as in GCHART, but a quick look at the help doesn't give any details (you can find a reference for the old way of doing it, still available with MIDPOINTS=OLD).

Grand Advisor
Posts: 16,897

Re: Proc gchart and the data behind the graph..Please help Thank you

Repost this in the SAS Graphics section rather than Statistical. Then one of the SAS Graphing experts will be able to help.

If you're open to using the SG Procedures (GCHART is outdated) then I believe there's a way to get the data behind the graph.

Proc Freq or Proc Univariate should work as well Smiley Happy

Ask a Question
Discussion stats
  • 6 replies
  • 313 views
  • 0 likes
  • 4 in conversation