Monday, March 12, 2012

Segmentation code cross test technique

 By Kirk Harrington

With model validation or in the creation of segmentation code there is always the chance that code use to identify unique groups (or segments) is actually not mutually exclusive.  Here is a technique that I created to determine if this is a problem in your code. 

Copy and paste the code used to identify mutually exclusive groups to another section of your syntax (and when I say syntax, I mean you are working in a program like SAS ot SPSS).

Prior to the copied code, create g1 to gn+1 (however many groups you have plus one--the plus one covers a 'not assigned' by your codes category).  Then, instead of the group='group_name' variable in your pasted code from the previous step, make each group g1 to gn (how ever many groups) equal to 1.  Then create another line of code which will cover your 'not assigned' group.  Something like:  if g1=0 and g2=0 and g3=0 and .....gn=0 gn+1=1.

Run all the code.  You will have created g1 to gn+1 variables for each line in your dataset.  Now, change each g1 to gn+1 variable into a text (or string) 1 variable.  Create a concatenated field with these variables and run out a frequency table.  You will see results like this...

Example, 7 groups, 6 assigned, 1 not assigned

0100000   n
0010000   n

0110000   n
0001000  n
0000100  n
0000010  n
0000001  n

 Can you guess which code set (based on place holder) has problems with non-exclusiveness?  It would be code in placeholders 2 & 3.  Now that you know this, you can go back and troubleshoot those specific groups to determine where coding issues exist.  After you fix your code, you can re-run this test to see if your fixes worked.

------------------
An Effective Analyst Thought

There's nothing worse than a manager and analyst at odds.  The analyst is usually in the inferior position.  The temptation of the analyst may be to think that they are better, smarter, and that they can run things better than their manager.  Its really not that simple.  If you are at odds with your manager, find ways to improve your communications lines.  Otherwise, you will have a one-way ticket to looking bad and even if you could do a better job than your manager (which is not wrong to think), you may not get the chance one day to show it because of your behavior.

No comments:

Post a Comment