causalanalysis caEffect

Marketing Campaign Impact using Doubly Robust AIPW

Scénario de test & Cas d'usage

Business Context

A retail bank wants to evaluate the effectiveness of a new email promotion ('Promo') versus no contact ('Control') on customer credit card spending. They need a robust estimation that corrects for confounding factors like Age and Income, providing confidence intervals for the decision makers.
About the Set : causalanalysis

Causal inference analysis and effect estimation.

Discover all actions of causalanalysis
Data Preparation

Creation of 5000 customer records with confounding variables (Income, Age), a binary treatment (Promo/Control), and a continuous outcome (Spending).

Copied!
1 
2DATA mycas.marketing_campaign;
3call streaminit(12345);
4DO i = 1 to 5000;
5age = rand('NORMAL', 35, 10);
6income = rand('LOGNORMAL', 10, 0.5);
7prob_promo = logistic(-2 + 0.05*age + 0.00001*income);
8IF rand('UNIFORM') < prob_promo THEN treatment = 'Promo';
9ELSE treatment = 'Control';
10spending = 100 + 50*(treatment='Promo') + 2*age + 0.001*income + rand('NORMAL', 0, 50);
11OUTPUT;
12END;
13 
14RUN;
15 

Étapes de réalisation

1
Fitting the Outcome Model (Spend) and Propensity Score Model (Treatment assignment).
Copied!
1 
2PROC CAS;
3regression.glm TABLE={name='marketing_campaign'}, class={'treatment'}, model={depvar='spending', effects={'treatment', 'age', 'income'}}, store={name='outcome_mdl', replace=true};
4logistic TABLE={name='marketing_campaign'}, class={'treatment'}, model={depvar='treatment', effects={'age', 'income'}}, store={name='ps_model', replace=true};
5logistic.score TABLE={name='marketing_campaign'}, restore={name='ps_model'}, casout={name='scored_data', replace=true}, copyVars={'spending', 'treatment', 'age', 'income'};
6 
7RUN;
8 
2
Execution of caEffect using AIPW method with Inference enabled to get ATE (Average Treatment Effect).
Copied!
1 
2PROC CAS;
3causalanalysis.caEffect TABLE={name='scored_data'}, method='AIPW', treatVar={name='treatment'}, outcomeVar={name='spending', type='CONTINUOUS'}, outcomeModel={restore={name='outcome_mdl'}, predName='P_spending'}, pom={{trtLev='Promo', trtProb='P_treatmentPromo'}, {trtLev='Control', trtProb='P_treatmentControl'}}, difference={{evtLev='Promo', refLev='Control'}}, inference=true, alpha=0.05;
4 
5RUN;
6 

Expected Result


The action successfully calculates the Potential Outcome Means (POM) for Promo and Control. It produces the 'CausalEffects' table showing the ATE (Average Treatment Effect) of the promotion on spending, including Standard Errors and 95% Confidence Intervals, confirming the 'Doubly Robust' nature of the estimation.