Hello, I am having trouble using a SAS macro that was described in a paper. Can you please tell me what step I am missing? Thank you. From Valeri 2013: The macro has been developed using SAS Version 9.2. In order to implement mediation analysis via the mediation macro in SAS the investigator first opens a new SAS session and inputs the data, which has to include the outcome, treatment and mediator variables as well as the covariates to be adjusted for in the model. Macro activation requires then the investigator to save the macro script and input information in the statement: %mediation(data= ,yvar= ,avar= ,mvar= ,cvar= ,a0= ,a1= ,m= ,nc= ,yreg= ,mreg= ,interaction=)
run; So, I prepped my dataset and plugged in the values needed for the macro like this (values aren't important here, i just want to know how to ues this macro. %mediation(data=test, yvar=outcome, avar=exposure, mvar=med, cvar=cov, a0=0, a1=1, m=1, nc=1, yreg=logistic, mreg= logistic, interaction=false)
run; Then, I get the following error: WARNING: Apparent invocation of macro MEDIATION not resolved.
ERROR 180-322: Statement is not valid or it is used out of proper order. What am I doing wrong? Do I have to define the macro elsewhere? How does SAS know what to do with this macro? Thank you!
... View more