Data defines the model by dint of genetic programming, producing the best decile table.


Creating Time-On-File Variable
Bruce Ratner, Ph.D.
Live chat by Boldchat
Live chat by Boldchat

Objective: To create a Time-On-File (months) variable, an important variable for acquisition and retention modeling, as well as for segmentation.

Mos_on_File

Solution:

data dates_on_file;
input name $ date_on_file :mmddyy10.;
cards;
Abe 12/31/1973
Bruce 02/28/1976
Charles 03/29/1976
Dain 03/01/1976
Everett 12/12/1976
Frank 02/14/1971
George 11/09/1967
Hanks 07/02/1955
Irwin 07/30/1960
Jake 06/23/1959
;
run;

data months_on_file;
set   dates_on_file;
date_data_pulled ='15apr2002'd;

Months_on_File          = int(intck('month',date_on_file,date_data_pulled));
if month(date_on_file)  = month(date_data_pulled)
then Months_on_File   = Months_on_File - (day(date_on_file )> day(date_data_pulled));
format  date_on_file date_data_pulled worddate20.;
run;

proc print;
title2 ' Calculating Months_on_File ';
run
;

For more information about this article, call Bruce Ratner at 516.791.3544 or 1 800 DM STAT-1; or e-mail at br@dmstat1.com.
Sign-up for a free GenIQ webcast: Click here.