Help with plot of GBARLINE

Reply
Contributor
Posts: 30

Help with plot of GBARLINE

Hello Experts,

Need your suggestions/help for the problem I am facing.

Here is the dataset, the code and the current output:

Dataset:

PeriodAmountChange
31/03/071003.5
30/06/071103
30/09/0711610
31/12/071254
31/03/081183.2
30/06/081283
30/09/081353.5
31/12/081404
31/03/091452
30/06/0915312
30/09/091301.5
31/12/091351
31/03/101201.5
30/06/101402
30/09/101521
31/12/101642
31/03/111751.5
30/06/1118015
30/09/111882
31/12/111951.7

CODE:

/*****************************************************/
symbol1 value=dot height=0.25 interpol=join color=red;
axis1 minor=none label=(angle=90 "change") ;
axis3 minor=none label=("Year") ;
axis2 minor=none label=(angle=270 color=red "amount") value=(color=red);

proc gbarline data=GBARLIN1;
      bar period / discrete type=mean  sumvar=change raxis=axis1 maxis=axis3 inside=mean width=8 space=4;
      plot/sumvar=amount axis=axis2;
      format period year4.;
      format change 4.1;
      format amount 3.;
      run;
quit;
/*****************************************************/

Current OUTPUT:

gbarline_plotissue.JPG

The issues are:

1) For the plot , I needed the amount to be plotted and not their SUM or MEAN...That is no statistics...How do I achieve this?

2) Can I plot all the values on the line (i.e., all the quarter values)  not just values at midpoint?  (that is the bars will be yearly mean of one of the

variable(change) while plot should be representing the exact value of the other variable (amount) for all the quarters (but no mean/sum) )

Thanks!

Contributor
Posts: 30

Re: Help with plot of GBARLINE

Posted in reply to VijayKumar

Hello Experts,

Please help me with your suggestions!!Smiley Sad

-VK

Super User
Posts: 11,343

Re: Help with plot of GBARLINE

Posted in reply to VijayKumar

The reason your periods are grouped is the use of : Foramat period year4.; which is telling SAS to group and display by year. Use YYQ6. YYQS8. or similar.

If the data is already summarized as it appears in your case the choice of statistic doesn't matter but the procedure does expect to have a statistic. I think with the format change above you'll get what you're looking for.

Contributor
Posts: 30

Re: Help with plot of GBARLINE

Thanks Ballard for you reply. Your explanation is correct!

But, I have used YEAR4. because I want yearly average per BAR...

and for the plot I wanted all the points plotted.  But the problem is that the plot is plotting at midpoints only. Is there some trick to have plot display all the values?

In short, for BAR... it should group while for PLOT it should not group.


Ask a Question
Discussion stats
  • 3 replies
  • 206 views
  • 0 likes
  • 2 in conversation