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

I'm trying a SAS example from the SAS help on my laptop. It basically tells how to use proc causalmed for survival analysis. However, I kept getting "error 73-322: Expecting an =." under "weeks*censor(1)".

I also tried my own code for the same analysis and got the same error.

Here is the link from SAS help web about proc causalmed with survival analysis:

https://documentation.sas.com/doc/en/statug/v_003/statug_causalmed_examples05.htm 

Does anyone know how to fix it or do survival analysis in proc causalmed? I really appreciate it!

Below is the example code:

proc causalmed data=RedDye ciratio=log poutcomemod pmedmod;
   class RedDye Female Tumor;
   model Weeks*Censor(1) = RedDye | Tumor / aft;
   mediator Tumor(event='1') = RedDye(treat='3');
   covar Female;
   freq Freq;
run;

  

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

The doc you have linked to is for SAS Viya. If you are using SAS 9, you need to make sure you are looking at the version of the documentation that corresponds to your version of SAS. For example, here is a link to the SAS/STAT 15.1 doc, which shipped with SAS 9.4 M6:

https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_causalmed_syntax.htm

 

You will notice that the syntax for censored observations is not supported in SAS/STAT 15.1.

View solution in original post

4 REPLIES 4
Rick_SAS
SAS Super FREQ

The doc you have linked to is for SAS Viya. If you are using SAS 9, you need to make sure you are looking at the version of the documentation that corresponds to your version of SAS. For example, here is a link to the SAS/STAT 15.1 doc, which shipped with SAS 9.4 M6:

https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_causalmed_syntax.htm

 

You will notice that the syntax for censored observations is not supported in SAS/STAT 15.1.

aw016
Obsidian | Level 7

Hi there,

Thank you so much for your answer!

I didn't notice that doc was for SAS Viya, however, the link you posted seems to have the same statements as what I ran before. It still shows the same error.

Basically, my code is below:

 

proc causalmed data=hw.final psummary;
 mediator waist_sc= n_mets_nowc; 
 model FT_CHD97*New_CHD97(1)=waist_sc n_mets_nowc;
 covar Age_V1 race sex SMOKING;
run;

 

 

And the error looks like this:

2    proc causalmed data=hw.final psummary;
NOTE: Writing HTML Body file: sashtml.htm
NOTE: PROCEDURE CAUSALMED used (Total process time):
      real time           0.16 seconds
      cpu time            0.14 seconds

NOTE: The SAS System stopped processing this step because of errors.
3     mediator waist_sc= n_mets_nowc;
4     model FT_CHD97*New_CHD97(1)=waist_sc n_mets_nowc;
                    -
                    73
                    76
ERROR 73-322: Expecting an =.
ERROR 76-322: Syntax error, statement will be ignored.
5     covar Age_V1 race sex SMOKING;
6    run;

If I replaced New_CHD97(1) to New_CHD97(0), the error is still there.

Rick_SAS
SAS Super FREQ

The link I sent (SAS 9.4) has the syntax

  • MODEL outcome=effects </ model-options>;

whereas the Viya documentation supports the syntax

  • MODEL outcome <*censor(list)> <(outcome-options)> =effects </ model-options>;

Therefore, the syntax you are trying to run is not supported in SAS 9.4.

aw016
Obsidian | Level 7

Oh, I see what you say, thank you, Rick_SAS!

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 Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1121 views
  • 4 likes
  • 2 in conversation