BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
blund
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
jiltao
SAS Super FREQ

 

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

 

 

View solution in original post

2 REPLIES 2
jiltao
SAS Super FREQ

 

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

 

 

blund
Obsidian | Level 7

OK ... thanks for the response.

Bruce Lund

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 422 views
  • 2 likes
  • 2 in conversation