BookmarkSubscribeRSS Feed
kmwats
Calcite | Level 5

Hi. I am using PROC CAUSALMED for mediation analysis for the first time.

 

I have survey data. Can strata, cluster, and weight options/statements be added in PROC CAUSALMED?

 

I have this but need to add strata, cluster, and weight...

 

proc causalmed data =nhanes.data all;
model mi=dog ;
mediator bmxbmi=dog;
covar age smoker alc_ok dmdeduc2 riagendr;
run;

 

Thanks!

7 REPLIES 7
greveam
Quartz | Level 8

The short answer is yes. You can read more here: https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/1991-2018.pdf and/or by accessing the online SAS documentation for proc causal med.

 

Good luck!

kmwats
Calcite | Level 5
I think you mean using PROC PSMATCH for propensity scoring. It does look
like it may work for my data. Thank you!
dbcrow
Quartz | Level 8
Any progress on this since the post? I'm facing the same problem.
dbcrow
Quartz | Level 8

The documentation makes clear that PROC CAUSALMED doesn't accommodate even weight vectors, much less weights from a more complex survey scheme. There is no "WEIGHT" statement in the proc, unfortunately. 

 

Any more thoughts on this? 

Season
Barite | Level 11

First of all, please make sure about the module you wish to invoke for your analysis. @kmwats orignially raised questions on PROC CAUSALMED but digressed to PROC PSMATCH as he/she found it suitable for his/her analysis.

Second, based upon your reply, it seems that you are really looking for information on conducting complex survey data analysis with PROC CAUSALMED. If that is the case, then I regret to inform you that the SAS's built-in SURVEY procedures only serve to conduct a fraction of complex survey data analysis. In other words, many of the complex survey data versions of advanced statistical methods are not supported by SAS's built-in procedures. Mediation analysis in the setting of complex survey data analysis is one of the methods not supported by SAS's built-in proceudres till now.

To get around this with SAS, you must either be quite familiar with the algorithms of the method and compile a macro from scratch or search on the web and use a macro compiled by someone else, if there is any. However, given my experience in complex survey data analysis, it is usually quite futile to search on the web over and over again for a SAS macro, as the number of SAS users skilled at complex survey data analysis and willing to deal with the very problem you encounter is too small for the generation of at least one paper on every particular problem.

Therefore, I suggest that you search on the web briefly to see if anybody has compiled such macros. If the answer is no, then I suggest that you stop searching for SAS macros and switch to looking for R packages. It is much more likely to find R packages for a certain question than to find a SAS macro for the same one.

dbcrow
Quartz | Level 8

Thanks for this suggestion.

 

I had searched R for analysis of survey data. There's the "survey" package, but SAS is far superior to R for analyzing complex survey data. The R "survey" package doesn't even support cross-tabulations; I had to write a function to "trick" the package into doing a crosstab. R has no package for mediation analysis with complex survey data. 

SAS_Rob
SAS Employee

One option might be to make use of the WEIGHT statement in Proc CAUSALMED to run with one of the replication methods.  The general approach would be to use one of the SURVEYXXX procedures to compute the replicate weights and then to run CAUSALMED with each set of replicate weights. 

There is an example of doing something similar with Proc GENMOD.  You could likely adapt this example by substituting the CAUSALMED step for the GENMOD step.  You might need to do some research to see if this would be statistically valid, but I have seen others use a similar approach with BRR for mediation models.

SAS/STAT Poisson Regressions for Complex Surveys

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 7 replies
  • 1797 views
  • 3 likes
  • 5 in conversation