New to Visual Analytics and trying to find a way for creating an interactive report to display weighted and unweighted values (mean, median) with a drop-down menu for various variables. Is this dynamically possible?
I am not sure exactly what you are trying to do without more details, but you can find an example on how to calculate a weighted average at https://blogs.sas.com/content/sgf/2014/10/24/how-to-calculate-the-weighted-average-in-sas-visual-ana....
If you want the value of the weight to be dynamic, you could create a parameter that is passed to this calculation. Documentation on parameters can be found at https://go.documentation.sas.com/doc/en/vacdc/v_029/vareportdata/n1wv50n60ccq86n1nzp6zat1wj64.htm.
You can also specify the aggregation for a measure to AVERAGE or MEDIAN using the attributes of any data item. You can also duplicate a data item if you want to have multiple aggregations defined for the same measure.
Hopefully this will get you headed in the right direction.
Weighted average should be fine but what about weighted median in Visual Analytics? I'm comparing this to the "weight" option in proc means.
Example below shows the weighted average which can be done in multiple steps in Visual Analytics using Aggregated Measure (Sum(ByGroup,var*wgt)/Sum(ByGroup,wgt)). What about the weighted median?
var | wgt | var*wgt | |
1 | 1 | 1 | |
2 | 2 | 4 | |
3 | 3 | 9 | |
4 | 3 | 12 | |
5 | 3 | 15 | |
12 | 41 | 3.416667 |
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.