This documentation link gives the formula for ATT weights (Let ps=propensity score, t is treatment)
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_causaltrt_details06.htm
The formulas for the weights are:
Control: Let CTOTAL = Sum[ (1-t)*ps/(1-ps) ]. Then a control weight is ( (1-t)*ps/(1-ps) ) / CTOTAL
Treated: Let TTOTAL = Sum[ t ]. Then a treated weight is t / TTOTAL
I don’t see how the weights from the PROC CAUSALTRT example are in agreement with the formulas. See column ATTwgt2 in the example below.
In particular, I think the weights for the treated observations should all equal 0.2 … which is not in agreement with column ATTwgt2. Any help is appreciated!
data WORK;
input Y T X;
datalines;
1 0 1
2 1 1
3 0 1
1 1 1
1 0 3
1 1 3
4 0 4
2 0 4
3 1 4
2 0 4
3 0 4
2 1 4
;
PROC CAUSALTRT DATA= WORK ATT;
CLASS X;
PSMODEL T(descending)=X;
MODEL Y;
OUTPUT OUT=OUTwork2 PS=PS2 IPW=ATTwgt2;
proc print data = OUTwork2;
run;
Obs Y T X PS2 ATTwgt2
1 1 0 1 0.50000 2.00000
2 2 1 1 0.50000 2.00000
3 3 0 1 0.50000 2.00000
4 1 1 1 0.50000 2.00000
5 1 0 3 0.50000 2.00000
6 1 1 3 0.50000 2.00000
7 4 0 4 0.33333 1.50000
8 2 0 4 0.33333 1.50000
9 3 1 4 0.33333 3.00000
10 2 0 4 0.33333 1.50000
11 3 0 4 0.33333 1.50000
12 2 1 4 0.33333 3.00000
The weight in the OUTPUT OUT= ipw= statement in PROC IRT is the weight values for ATE. For the weight values for ATT, you can use the following data step code to obtain it --
data outwork2;
set outwork2;
ipwATT = ps2 * ipw2;
run;
where the data set outwork2 is from the OUTPUT OUT= statement in PROC CAUSALTRT --
PROC CAUSALTRT DATA= WORK ATT;
CLASS X;
PSMODEL T(descending)=X;
MODEL Y;
OUTPUT OUT=OUTwork2 PS=PS2 IPW=ipw2;
run;
We will add the IPW values for ATT in the next release.
Thanks,
Jill
The weight in the OUTPUT OUT= ipw= statement in PROC IRT is the weight values for ATE. For the weight values for ATT, you can use the following data step code to obtain it --
data outwork2;
set outwork2;
ipwATT = ps2 * ipw2;
run;
where the data set outwork2 is from the OUTPUT OUT= statement in PROC CAUSALTRT --
PROC CAUSALTRT DATA= WORK ATT;
CLASS X;
PSMODEL T(descending)=X;
MODEL Y;
OUTPUT OUT=OUTwork2 PS=PS2 IPW=ipw2;
run;
We will add the IPW values for ATT in the next release.
Thanks,
Jill
OK ... thanks for the response.
Bruce Lund
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.