umb001.jpg                                        USING PROPENSITY SCORES IN QUASI-EXPERIMENTAL DESIGNS

William M. Holmes

 

SAS COMMANDS FOR PROPENSITY USE

 

            An overview of SAS commands for propensity score use is given in: http://support.sas.com/resources/papers/proceedings12/314-2012.pdf.   There are multiple ways for using SAS commands for this purpose.  These are only some of them. SAS also has an interface for running R commands.  So, they may be employed as well.

 

IMBALANCE ASSESSMENT

Imbalance assessment can be done with the anova procedure or with the glm procedure

proc anova data=mydata;

               class treatm;

                model treatm = confounder1,confounder2,confounder3;

 run;

 

proc glm data = mydata;

              class treatment;

  model treatment = confounder1 confounder2

  means treatmment;

run;

 

 

PROPENSITY ESTIMATION

Estimation with logistic regression can be done with the proc logistic procedure or discriminant function anaysis (proc candis).

 

proc logistic;

              model treatm=confounder1,confounder2,confounder3 /lackfit outroc = ps_r;

              output out= ps_p XBETA=ps_xb STDXBETA= ps_sdxb PREDICTED = propen;

run;

 

proc candisc data=mydata out=outcan distance anova;

                class treatm;

      var confounder1 confounder2 confounder3;

     output out=ps_p PREDICTED=propen;

   run;

 

MATCHING

            Some matching can be done with SAS macros and commands.  Other matching options are available through the R interface.

 

            Exact and Coarsened Exact

          The webpage http://support.sas.com/resources/papers/proceedings12/314-2012.pdf. contains SAS commands for 1-1 exact matching.

 

            Nearest Neighbor and Caliper

            The webpage http://support.sas.com/resources/papers/proceedings12/314-2012.pdf. contains SAS commands for 1-1 caliper matching.

 

            1-Many

            One many matching is only available through R matching programs. These can be used with the R interface for SAS.

 

            Optimized, Full, or Genetic

            These forms of matching are available trough the R matching programs. They can be used with the R interface for SAS.

 

STRATIFYING

Strata are created by creating a recoded propensity score variable.

            propenstrata= .;

            IF (propen <.2) THEN propenstrata = 1;

            IF (propen>=.2) and (propen<.4) THEN propenstrata = 2;

            IF (propen>=.4) and (propen<.6) THEN propenstrata = 3;

            IF (propen>=.6) and (propen<.8) THEN propenstrata = 4.

            IF (propen>=.8) THEN propenstrata=5.

 

REGRESSION AND THE GENERAL LINEAR MODEL

Regression and the general linear model estimation may be done with the glm program.

 

proc glm data = mydata;

  class treatm;

model outcome = treatm covariate1

means treatm;

run;

 

TWO-STAGE LEAST SQUARES

Two-State Least Squares regression may be done with the syslin proc.

 

proc syslin data=mydata  2sls;

endogenous treatm;

instruments instrument1 instrument2 instrument3;

effects: model outcome1=treatm instrument1 instrument2 instrument3;

run;

 

SAMPLE WEIGHTING

 

wt=0;
if treatm=0then ipw=1/propen;
if treatm=1then wt=1/(1-propen);
proc freq data=mydata.new;
tables counfounder1,confounder2,confounder3;
weight ipa;
run;

 

WEIGHTED LEAST SQUARES

The simplest form of Weighted Least Squares regression in SAS can be done with the regression procedure.  More complicated models can be estimated with the glm procedure. The “p” option in the  MODEL line below calculates the estimated dependent variable.

 

PROC REG DATA=mydata;

        MODEL  outcome1=treatm covariate1/ p;

        VAR outcome1 treatm covariate1 ipw;

        WEIGHT ipw;

         OUTPUT OUT=mydataout  PREDICTED=outcome1pred.;

         BY variables;

 

GENERALIZED LINEAR MODEL

          Generalized Linear Model estimation (GZLM within the text) can be done with the genmod procedure. The example estimates a logistic regression.

 

PROC GENMOD;

MODEL outcome1 = treatm/ link=logit dist=binomial;

RUN;

 

MISSING DATA ANALYSIS

            Missing data analysis can be performed with the missingpattern macro or the mianalyze procedure. The mianalyze procedure produces mda as part of a multiple imputation procedure.

 

            %macro missingPattern(datain=mydata, varlist=confounder1 confounder2 confounder3,

            exclude=’FALSE’, missPattern1=’TRUE’, dataout1=mydatam1, missPattern2=’TRUE’,

            dataout2=’mydatam2’, missPattern3=’TRUE’, dataout3=mydatam3,

            missPattern4=’TRUE’,  dataout4=mydatam4);

 

            proc mianalyze;

modeleffects confounder1 confounder2 confounder3 ;

stderr sconfounder1 sconfounder2 sconfounder3;

run;

 

IMPUTATION OF MISSING DATA

            Imputation can be done with the mi or the mianalyzis procedures.

         

            proc mi data=mydata seed=12345  out=mydatami simple;

            var confounder1 confounder2 confounder3;

            run;

 

            proc mianalyze;

modeleffects confounder1 confounder2 confounder3 ;

stderr sconfounder1 sconfounder2 sconfounder3;

out=mydatami;

run;

 

 

return to Home 

Revised 1/31/2013