BookmarkSubscribeRSS Feed
Liamb
Obsidian | Level 7

Hello,

 

I used the codes at below to estimate the propensity score and logistic regression for inverse probability weighting.

How can I test the balance of the standardised mean differences before and after adjustment?

How to obtain the synthetic n values derived from weights?

 

Thanks

 

/***CREATING PROPENSITY SCORES********/

proc sort data=tab_imput; by _imputation_;run;
proc logistic data=tab_imput desc;
class var1 var2 var3 var4 var5 var6 var7 var8 var9 ;
model mut= var var1 var2 var3 var4 var5 var6 var7 var8 var9/link=logit rsquare ;
output out=denom p=d;
by _imputation_;
run;
		
proc logistic data=tab_imput desc;
model mut=;
output out=num p=n;
by _imputation_;
run;

proc sort data=tab_imput ;
by anonymat;run;
proc sort data=denom;
by anonymat;run;
proc sort data=num;
by anonymat;run;

data tab_imput_pscore;
merge tab_imput denom num;
by anonymat;
if mut=1 then uw=1/d; else if mut=0 then uw=1/(1-d);
if mut=1 then sw=n/d; else if mut=0 then sw=(1-n)/(1-d);
run;
proc sort data=tab_imput_pscore; by _imputation_;run;

/***PROPENSITY SCORE WEIGHTED OUTCOME MODEL****/

ods graphics on;
proc logistic data=tab_imput_pscore desc; 
	class mut(ref='no') / param=reference ; 
	model vif (event='no') = mut/ rsquare clodds=wald lackfit ;
	weight sw ;
    by _imputation_;
    oddsratio mut;
    ods output parameterEstimates  = ipw_mut ;
run;
ods graphics off;
proc mianalyze parms=ipw_mut ;
modeleffects mut;
ods output parameterEstimates  = ipw_mut1;
run;

data ipw_mut2; set ipw_mut1;
OR_est=EXP(ESTIMATE);
LCI_OR=OR_est*EXP(-1.96*STDERR);
UCI_OR=OR_est*EXP(+1.96*STDERR);
run;

proc print data=ipw_mut2;
var Parm OR_est LCI_OR UCI_OR Probt ;
run;
4 REPLIES 4
SAS_Rob
SAS Employee

In order to combine any statistics from multiply imputed data you need the point estimate and a standard error.  Do you know how the standard errors for standardized mean differences and synthetic Ns would be calculated?

Liamb
Obsidian | Level 7

Standrd erros will be estimated according to Rubin's rules. For parameter estimates, averages are taken. Their variance is basically a combination of the average squared standard errors plus the variance of the parameter estimates across the imputed data sets.

SAS_Rob
SAS Employee

The standard errors that I was referring to were associated with the point estimates themselves, not the combined estimates.  In other words, do you have a formula that reflects the standard errors that you will eventually average in the first half of Rubin's methodology?

Liamb
Obsidian | Level 7

I'm not sure but I think it is the following formula for standard mean difference (SMD):

Liamb_0-1716215611455.png

 

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
  • 4 replies
  • 367 views
  • 0 likes
  • 2 in conversation