BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
violet77
Calcite | Level 5

Hello,

I am using proc causalmed for survey data and would like to include sampling weights. However, I am unsure where to include the weight statement. I tried to include it after the covar statement but receive an error in SAS saying that the weight statement was out of order. Thanks!

 

PROC CAUSALMED DATA=;
CLASS;
MEDIATOR;
MODEL;
COVAR;

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @violet77,

 

The WEIGHT statement of PROC CAUSALMED was introduced in SAS/STAT 15.1. I'm using SAS/STAT 14.3 as part of SAS 9.4M5, where it was not available yet (compare the 14.3 documentation to the 15.1 documentation). So, for obvious reasons, I get the error message

20      weight w;
        ------
        180
ERROR 180-322: Statement is not valid or it is used out of proper order.

which I suspect is the same as you got.

 

Please check your SAS version with

%put &sysvlong;

or the SAS/STAT version with

proc product_status;
run;

 

I'm afraid I wouldn't know a workaround (other than an upgrade) if your version was the same as mine or older.

View solution in original post

5 REPLIES 5
sbxkoenk
SAS Super FREQ

Hello,

 

I have never used PROC CAUSALMED (although I know what it is meant for) but I do not think the WEIGHT statement should get a particular place in the order of statements. Same for the COVAR statement.

 

I think it's best that you show us the LOG.

When you reply, hit the </> (Insert Code) button in the toolbar and paste the LOG in the pop-up window.

That way the LOG preserves structure and formatting which makes it easier to read.

 

Thanks,

Koen

FreelanceReinh
Jade | Level 19

Hello @violet77,

 

The WEIGHT statement of PROC CAUSALMED was introduced in SAS/STAT 15.1. I'm using SAS/STAT 14.3 as part of SAS 9.4M5, where it was not available yet (compare the 14.3 documentation to the 15.1 documentation). So, for obvious reasons, I get the error message

20      weight w;
        ------
        180
ERROR 180-322: Statement is not valid or it is used out of proper order.

which I suspect is the same as you got.

 

Please check your SAS version with

%put &sysvlong;

or the SAS/STAT version with

proc product_status;
run;

 

I'm afraid I wouldn't know a workaround (other than an upgrade) if your version was the same as mine or older.

violet77
Calcite | Level 5

Thanks! I have SAS/STAT 14.3. I appreciate your help! I will see if I can upgrade to 15.1

violet77
Calcite | Level 5

Hello,

I was able to get SAS/STAT 15.1. However, I ran into another issue. When I estimated my model with the weight statement, I received this message:

WARNING: The covariance matrix for the outcome model is not positive definite. The convergence is questionable.
WARNING: The covariance matrix for the mediator model is not positive definite. The convergence is questionable.
WARNING: Standard errors are not computed for the effect estimates.

 

Thanks!

FreelanceReinh
Jade | Level 19

This is most likely an issue with your input data. Please open a new thread (e.g., with subject line "Proc Causalmed: covariance matrix not positive definite") in this forum ("Statistical Procedures") so that all experts will see it. I'm still on SAS/STAT 14.3 and hence couldn't run your code even if I had similar input data.

 

Good luck!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 5 replies
  • 1182 views
  • 0 likes
  • 3 in conversation