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!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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