BookmarkSubscribeRSS Feed
Cyril_FR
Calcite | Level 5

Dear All,

My objective is to validate some weird results coming from the PROC STRATIFY (package Statxact v8) for testing homogeneity of odds ratio:

if you recode the treatment variable (tpattdcr in the piece of code below) in the input dataset ‘Tio 5’ to ‘tio 5’ you get slightly different p-values for the monte carlo estimate of the Zelen’s test (with my dataset 0.96160 and 0.96200)?


PROC STRATIFY DATA=&inds SEED=311875 OUT=&outds;

HO/mo;

RO tpattdcr;

CO censored;

STRATUM trial;

WEIGHT cnt;

RUN;



I have been pleasantly surprised when I found out that since SAS v9.2, there is an option in the PROC FREQ to calculate the monte carlo estimate of the Zelen's test (see Base SAS(R) 9.2 Procedures Guide: Statistical Procedures, Third Edition and the piece of code below). Unfortunately when I tried to run the procedure I got an error message saying that the monte carlo estimation is not available for Zelen's test (that contradicts what is mentioned in the SAS help)?

proc freq data=&inds;

tables trial*tpattdcr*censored;

exact zelen / mc SEED=311875;

WEIGHT cnt;

RUN;


Don’t hesitate to contact me if you need more details.


Best regards,

Cyril

7 REPLIES 7
SteveDenham
Jade | Level 19

This should work for h x 2 x 2 tables (I'm looking at SAS/STAT12.1 documentation), so for h trials, tpattdcr with two levels, and censored with two levels, it should work.  If there are more than two levels of tpattdcr, it might be the cause (and it might be the cause of the odd behavior of STRATIFY), as PROC FREQ can get picky about level names.

Steve Denham

Cyril_FR
Calcite | Level 5

Thanks for the prompt response but I've got exactly h x 2 x 2 tables.

Concerning the proc freq, I don't understand why the monte carlo estimation is not working for Zelen's test?

Concerning the proc stratify, I tried to create a numerical variable for treatment coded (0,1) and I get the same result as with the treatment variable in a character coded ("tio 5","placebo") but slightly different from the character variable coded ("Tio 5","placebo")?

Best regards,

Cyril

SteveDenham
Jade | Level 19

Before opening a ticket with Tech Support (which is what I think this is going to require), make sure that you are running SAS v9.3 (TS1M2) to have access to SAS/STAT 12.1 (even though this should be available in SAS9.2).  Try the alias, EQOR, instead of zelen.

proc freq data=&inds;

tables trial*tpattdcr*censored;

exact eqor / mc SEED=311875;

WEIGHT cnt;

RUN;

Basically, this should give you the material that Tech Support will want to know when you contact them.

Steve Denham

Cyril_FR
Calcite | Level 5

Dear Steve,

FYI we've got SAS v9.2 TS level 2M3 installed on the server.

With EQOR, I got exactly the same note:

NOTE: PROC FREQ computes the exact p-value, not a Monte Carlo estimate, for Zelen's test.

Thanks for your help.

Best regards,

Cyrille

SteveDenham
Jade | Level 19

Hi Cyril,

Now I see what is going on--the documentation regarding the MC option is not really clear:

The MC option is available for all EXACT statistic-options except the BINOMIAL option and the following options that apply only to 2 x 2 or h x 2 x 2 tables: BARNARD, COMOR, EQOR, MCNEM, OR, RELRISK, and RISKDIFF. PROC FREQ computes only exact tests or confidence limits for these statistics.

So, as I now read it, no MC option is available for Zelen's test--only the exact value.  When you run the code without the MC option, what value do you obtain for Zelen's test?  Does it match what comes from StatXact?

Which still doesn't address the PROC STRATIFY issue of spelling/case changes affecting the results.  However, that will be a Cytel issue, I would think.

Steve Denham

Cyril_FR
Calcite | Level 5

Yes it wasn't very clear...

Without the MC option in the PROC FREQ, it matches the results coming from the PROC STRATIFY (with EX option) but I had to input only part of my dataset otherwise I got an error message saying that the sample size was too large (actually this is the point for using the Monte Carlo estimation: sparse data and large sample size... and in the end, for the Zelen's test, it's only available in the PROC STRATIFY).

FYI I have already contacted the Cytel support, I will let you know the outcome.

Thanks again and Have a great weekend!

Cyril

SteveDenham
Jade | Level 19

I hope that SAS9.4/STAT12.2 adds additional Monte Carlo capabilities to PROC FREQ.  It seems rather unusual to provide exact solutions, but not have an alternative for large, sparse datasets of the h x 2 x 2 variety.

Steve Denham

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 7 replies
  • 2461 views
  • 0 likes
  • 2 in conversation