Exploring, modeling, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Plot of Standard Deviation in SAS VA Report Designer

Reply
Contributor
Posts: 38

Plot of Standard Deviation in SAS VA Report Designer

[ Edited ]

Hi,

I am struggling with creating a visualization that represents the scatter/standard deviation...around a particular measure.
Adding the simple error bars has been an issue; getting a box plot another issue...

 

My data has daily measures and I want to aggregate them by month, showing the average and for example the 1st and 3rd Quartile.
I have started using a custom graph with a vector and a line graph. But I got no where... 

I guess, what I am looking for are suggestions of visualizations that have worked in SAS VA. There are plenty out there in SAS, excel...but I would like to know how is has been represented in SAS VA.

i will keep this post updated in case I find one way.

 

Cheers

 

rita

 

 

Just to give an example what I have been trying out. 

Stock high-Low Profile Plot

When I have the source data aggregated in te lvel that I want to display, the stock high-low plot seems to do the job.

image 1.PNG

 

However, when the data is daily and I would like the graph to aggregate my measurements monthly, I achieve a very different looking graph. Table with aggregation is fine. Just not the graph

image 2.PNG

The Output Graph (very different...)

image 4.PNG

 

If anyone knows the answer, what i might be doing wrong, it would be a massive help.
email back, if you have dealt with STD/scatter in another way...

SAS Super FREQ
Posts: 676

Re: Plot of Standard Deviation in SAS VA Report Designer

[ Edited ]

Hi

 

Are you looking for something like this, barchart with errorbars, see also attached screenshot.

 barchart_with_errorbars.PNG

Bruno

Contributor
Posts: 38

Re: Plot of Standard Deviation in SAS VA Report Designer

Hi Bruno,

Yes something like that.

And without needing to be an aggregation in the data preparation.

 

Can you post your instructions?

Thanks
Rita

SAS Super FREQ
Posts: 676

Re: Plot of Standard Deviation in SAS VA Report Designer

hi Rita

 

You can use a custom graph to build this. To create the custom graph, you can use this button when on the report obejcts tab.

errorBars05.PNG

 

 

Put two barcharts on top of each other and change the bar spacing for the second bar to make it smaller.

errorBars01.PNG

 

Next, edit the roles to change the names to be something sensible. Also allow multiple data assignments for the error bar because you will need to use two data points there.

 

errorBars02.PNG

 

Go to the properties of the first cell, the one with the two barcharts in it, and set the way color are given, this will ensure, that we only have to set the color for the error bars.

 

Set the grouping style for the second bar chart, the one that displays the error bars, to stack, so the two measures will be put on top of each other.

errorBars04.PNG

errorBars03.PNG

 

That is basically it, you might want to set other properties on how the bar are displayed. Save your custome graph to a folder and add it to the report objects tab.

 

You need two new aggregated measures computed with the follwoing expressions, you have to adapt it for the data item you want to display (change the name of 'HorsePower'n to the name you need.

 

errorBarMin, that is the value for the first measre on the errorBars role:

Avg [_ByGroup_] ('Horsepower'n) - ( 1 * StdDev [_ByGroup_] ('Horsepower'n) )

the second aggregated measure looks like this:

errorBars, that is the actual value for the error bars:

2 * StdDev [_ByGroup_] ('Horsepower'n)

Use the custom graph in your report like this:

errorBars06.PNG

 

Learned this techniques from @PetriRoine.

 

Bruno

Contributor
Posts: 38

Re: Plot of Standard Deviation in SAS VA Report Designer

Thanks @Bruno_SAS!

I have tried to replicate the graph. However I have encounter a problem and I do not know which step I may have missed. The error bars are starting from 0, as the image below:

error bars.PNG

I have select the option: 

properties error bards.PNG

SAS Super FREQ
Posts: 676

Re: Plot of Standard Deviation in SAS VA Report Designer

Hi

 

First I would change the colors of the two measures errorBarMin and errorBars so that you can distinguish them from each other, currently they have the same color.

 

Second I would display the new data items within a list table to see whether the calculated numbers are correct.

 

Bruno

Contributor
Posts: 38

Re: Plot of Standard Deviation in SAS VA Report Designer

Hi @Bruno_SAS,

thanks so much. Yes it was the colour!
I had done the table and the calculations were correct.

 

If you have more useful customized graphs, please feel free to share.

 

Cheers,

Rita

Ask a Question
Discussion stats
  • 6 replies
  • 280 views
  • 1 like
  • 2 in conversation