Hello,
I'm hoping to create code that will conduct propensity score matching on principal components I've created in a PCA.
The data set is census data, where we created principal components on zip codes to understand underlying constructs of different zip codes throughout the state. I've flagged intervention zip codes where we have interventions being implemented, and the rest of the zip codes are controls. I've created propensity scores using PROC LOGISTIC.
I'm trying now to use fuzzy matching to match propensity scores for intervention zips to control zips on a 1:2 ratio.
CODE:
Proc Factor data= (data set)
out= work.pc_zip
nfact=11
simple
method=prin
priors=one
mineigen= 0.99
scree
rotate=varimax
round
flag=.40 ;
var (variables)
run;
*flagging intervention zips;
data work.pca_flag;
set work.pc_zip;
if zcat5 in (intervention zip codes) then interven=1; else interven=0;
run;
*creating propensity scores;
proc logistic data=work.pca_flag descending;
model interven = factor1 factor2 factor3 factor4 factor5 factor6 factor7 factor8 factor9 factor10;
run;
Thank you!
Have you considered using PROC PSMATCH instead?
Example: Matching with precomputed propensity scores
Otherwise, there's a couple of matching macro's here, GMATCH and VMATCH:
http://bioinformaticstools.mayo.edu/?category=20
@RebeccaB_ wrote:
Hello,
I'm hoping to create code that will conduct propensity score matching on principal components I've created in a PCA.
The data set is census data, where we created principal components on zip codes to understand underlying constructs of different zip codes throughout the state. I've flagged intervention zip codes where we have interventions being implemented, and the rest of the zip codes are controls. I've created propensity scores using PROC LOGISTIC.
I'm trying now to use fuzzy matching to match propensity scores for intervention zips to control zips on a 1:2 ratio.
CODE:
Proc Factor data= (data set)
out= work.pc_zip
nfact=11
simple
method=prin
priors=one
mineigen= 0.99
scree
rotate=varimax
round
flag=.40 ;
var (variables)
run;
*flagging intervention zips;
data work.pca_flag;
set work.pc_zip;
if zcat5 in (intervention zip codes) then interven=1; else interven=0;
run;
*creating propensity scores;
proc logistic data=work.pca_flag descending;
model interven = factor1 factor2 factor3 factor4 factor5 factor6 factor7 factor8 factor9 factor10;
run;
Thank you!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.