Wednesday, 18 May 2011

Making the results of the analysis accessible

We have all been there. You have just completed an analysis to be proud of. You cleverly collected data from many information sources. Then, through nifty data management that really shows your sas skills, you thickened the data mart with meaningful aggregations, transformations and imputations. And to cap it all, you performed some brilliant statistical modelling pushing your personal boundaries. But when you try to communicate this you encounter glazed looks and you feel your effort is not appreciated. Even worse, you learn that the results of your model (e.g. a segmentation of s scoring) are not really bought into by management and the business.
When I was a youngling I taught in the Open University introduction to statistics courses and similar courses which were compulsory as part of a degree in psychology. That was invaluable experience in honing and toning my ability to explain and discuss statistics. However, explaining what a regression is all about is rather different from telling people about the analysis and discussing the results. When I worked in mainland Europe I developed and adapted a mode of communicating results that was slightly peppered with ‘statistical jargon’. The people I worked with, such as marketing manager & back office managers, had some statistical training in their past. Not only were they comfortable with box plots, lift charts and stepwise variable selection they expected to hear about it. Moreover, there was appetite to explore innovative statistical techniques as it was perceived essential to the business’ survival in the market. When I started working in the UK I had to change the way I talked & presented. The people I worked with did not want to go beyond discussing basic averages. They still wanted sophisticated and advanced analysis and solutions but challenged me to communicate it at the ‘shop Stuart’ level. To an extent that is because some of the clients grew from the shop floor so to speak. Moreover, there is a tendency to share the results with field which is great. The ultimate challenge was supporting a team preparing for tough negotiations with the trade union where the spirit was sharing the facts and analysis so the discussions could focus on strategy and planning.
The current client I am working for is exploring how to improve the way the analytics team communicates and presents analysis, findings and recommendations. The analysts are asking themselves how to up their game and talk at the business statistics without seeing that glazed look. The challenge is not just the communication to the decision maker but how to gain buy-in form the field. The consensus is that we should not fall into the trap of telling everyone how great the analysis is. Instead the approach should be “you should trust us to do a good job, now lets tell you what we found.”  The trust in the team’s skills and abilities should be acquired through the daily interactions with the business. A presentation of results should focus on the Business and address it pain. It should not be a naval gazing exercise.
Taking a step back to basics, the key question is “What do they really what to know”?
·         What information sources did we explore – if we covered the data they expected and more then that? This is an important first step in gaining their confidence in you.
·         What are the main findings – they do not want to hear about coefficients and correlations. They would like a high level summary such as “The number of face to face sales visits does not seem to be predictive when accounting for X”. Even if they do not like the message, at least they understand it and they know that they should concentrate on X. They might ask for evidence and you should have the response ready in a format that is appropriate for the audience.
It is a misconception that the sleekness of the communication of the results flows from the dichotomy between “Academics in their ivory towers” and the “In tune consultants”. I witnessed a reputable consulting firm prepare a “Deck” of about 300 backup slides for an hour-short presentation. Admittedly, it was their way of getting the team to address questions and document the thought process along side the findings. However, after weeks of sleepless nights, the result was that no one in the team could remember what it was all about; not to mention reproduce the numbers. Moreover, instead of creating more confidence in the analysis it achieved the opposite. Each graph and table needed some time to digest and understand. Many of them just were showing no effect or statistically significant differences that were not practically significant. The longer this went on during the meeting the more the feeling was “These clever guys might understand this but I do not have the time – or are they pulling one over?”
We just finished a few high profile modelling and targeting projects for keystone products. Our findings were dispelling common beliefs and suggesting a new strategy. The first presentation that we prepared was the bog standard ‘Tell them everything – a graph is worth more than a 1000 words’. It did not work. I spent a week reworking the presentation and ended up with 7 slides with mainly bullets and only two killer graphs that together brought the message home. It worked really well. When designing the presentation and the graphs, I harked back to my student days (the first fish were starting to climb out of the see just about then) where Professor Benjamini (http://www.math.tau.ac.il/~ybenja/) introduced us to Tuffte’s work (http://www.edwardtufte.com/tufte/) and discussed other research about cognitive perception of graphical information (see: high overview in http://www.perceptualedge.com/files/GraphDesignIQ.html)
There are a few challenges to keep in mind:
·         Do the correct modelling – a elegant and simple presentation should not be an excuse to discount statistical rigour.
·         It is important to communicate the quality of the modelling. It is not easy for annalists to not mention correlations, p-values, PPVs, Sensitivity, Spesifity, and Lift Values. How ever, is it worth spending the time educating the un-interested. It is better to translate to terms they know. “If we use this model we are likely to visit 50% more GPs that will respond positively. Had we applied this last year we probably would have seen an increase in sales of about X Pounds.” – Now that is a challenge that merits a paper of its own.
·         Communicate the margins of error – managers understand worst case, expected case and best case scenarios.
·         Communicate innovation – that is not easy – keep trying until you get it write for your audience.
A good consultant should have the same confidence the public give to their doctors. They are trusted to know and be experienced. What we want of them is a diagnosis and a solution.
What is the right balance? To bullet or to graph?
The answer to that, I believe, is that the client is always right.

Wednesday, 23 February 2011

FCMP: BKf_BH Controlling the FDR


 Only once did I see the process for incorporation of cutting edge statistical theory into a new sas procedure and actually know the people. A long time ago, when fish just started to explore the idea of dry land living, I studied under Yoav Benjamini who together with Yosi Hochberg suggested (and named) the FDR as an alternative to the FEW. As is with many revolutionary concepts is was not accepted immediately. But once a few articles were written Yoav was contacted by sas who asked a few questions. It was some time ago so I am a little hazy on the details; but if my memory serves me right, I saw the actual letter. Subsequently Wolfinger (I Think) attended the MCP conference in Tel-Aviv and met Yoav, Yosi and Daniel Yekutieli.

 Sometime later, I was working at sas/Austria (or was it already sas/Denmark?) when a new proc was introduced MultTest. I was excited as it was relevant to my research and also included measures suggested by people I knew – Yosi Hochberg and Yoav Benjamini. I later discovered that Yosi’s measure may also be used in the mean statement for proc Anova and GLM (GT2).

 One thing jarred with me at the time. The option in proc MultTest to use the step-down FDR controlling procedure was called FDR. To my opinion it should have been BH for the Benjamini-Hochberg procedure. Apart for giving them their due and being consisted with the naming of the options such as Tukey, Dunnet etc., I knew of at least one other procedure at the time that controlled the FDR and expected more. Moreover, the naming confused between the procedure and the measure.

 Nowadays the FDR measure is mainstream, especially after its relevance to BioInformatics was recognized. More powerful procedures to control the FDR were proposed and some are implemented in sas 9.2. But I still like the elegance of the BH procedure.

 It was just natural that chose to explore the FCMP functionality through the prism of the FDR (download).

To try it run:

%Let n=3;
data test;
 * Array parameters to subroutine calls must be temporary arrays;
 array a(&n.) _temporary_;
 array b(&n.);
 array c(&n.) _temporary_;
 array d(&n.);
 input b1 b2 b3;
 do i=1 to &n.; a[i]=b[i]; end;
 call BKs_BH(a,c);
 do i=1 to &n.; d[i]=c[i]; end;
 datalines;
 0.05 0.01 0.95
 5.00 0.10 0.01
 0.05 0.05 0.05
 0.03 0.02 0.01
 run;
proc print;run;

Output
Obs     b1      b2      b3       d1      d2      d3

1     0.05    0.01    0.95    0.075    0.03    0.95
2     5.00    0.10    0.01    1.000    0.15    0.03
3     0.05    0.05    0.05    0.050    0.05    0.05
4     0.03    0.02    0.01    0.030    0.03    0.03


using sas V9.2/Base

Monday, 17 January 2011

FCMP: BKf_GateKeeper Function


By Eli Kling using sas V9.2/Base

From time to time the developers in Cary make an addition that excites even sas–dinosaurs like myself. Not everyone sees the potential of, or even the need for proc FCMP. However, I think it signals a major change in the way sas is used and developed and opens the door for cutting edge statistical modelling also on platforms that have ‘only’ Base/Stat/Graph.

The obvious challenge I first tackled as a learning exercise was calculating the Benjamini-Hochberg FDR correction to a vector of p-values. It was the focus of my dissertation a thousand years ago. I will discuss it in a following entry.

Good practice calls to first check that the vector passed in is appropriate and abort the processing otherwise. The BKf_GateKeepr function below checks that all the elements of a vector contain values between 0 and 1 and returns 0 for OK and 1 for Failed. If the check failed it also puts a message in the log.

As I intend to expand the functionality of this function I included a ‘Check’ switch indicating what check to perform. In the version below only ‘PVALUE’ is programmed.

You will also notice that the sas editor has a problem to correctly colour the key words. I am sure that will be fixed in later versions.

proc delete data=sasuser.BusinessKenLibrary; run;
options cmplib=sasuser.BusinessKenLibrary;

proc fcmp outlib=sasuser.BusinessKenLibrary.dev;

/* RC=BKf_GateKeeper(Vector,Check)
 a utility to be used to check vector inputs
 Input Vector - the vector of values to check
       Check  - what to check
       pvalue: verify all values between 0 and 1
 output RC - 0 = passed check
             1 = failed check
*/
 function BKf_GateKeeper(vector(*),Check$);
 put "check" Check;
 N=dim(Vector);
 RC=0;
  if Upcase(Check)="PVALUE" then do;
    do i=1 to N;
       if not(0<=vector[i]<=1) then RC=1;
      end;
    if RC=1 then put "<< BK Values Gate Keeper: A vector of pvalues was expected but at least one value was not in the interval [0,1]. Note, it might have been a missing value. >>";
   end;
 return(RC);
 endsub;

run;


/********/
/* Test */
/********/
data test;
 * Array parameters to subroutine calls must be temporary arrays;
 array a(3) _temporary_;
 a[1]=5;
 a[2]=0.01;
 a[3]=0.96;
 RC=BKf_GateKeeper(a,"Pvalue");
 run;
proc print;run;
/*****************************************************************/
/* Code End                                                      */
/*****************************************************************/