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

I am not sure which of these columns is my odds ratio and what I would use for graphing. My CHISQ input is this:

PROC FREQ DATA = ReAdm.CHI2 ORDER = DATA; BY COMPARISON;

WEIGHT COUNT;

TABLES SVRTY_LVL_CD*WHO*ADMISSION/CHISQ CMH FISHER EXPECTED;

EXACT OR;

OUTPUT OUT = ReAdm.Final OR CHISQ;

RUN;

The table that houses the information is formatted like this and has 6508 total rows:

comparison              who                   svrty_lvl_cd                       admission                       count

1111                       1111                          0                               admit                                2

1111                       1111                          0                              readmit                               1

1111                       national                      0                              admit                                41296

1111                       national                      0                              readmit                              1909

2222                       2222                          1                              admit                                  9

2222                       2222                          1                              readmit                               1

2222                      national                       1                             admit                               7592

2222                      national                       1                              readmit                           863

The pattern continues. The svrty_lvl_cd can be 0-4. The output after doing the above proc freq looks like this:

who                           svrty_lvl_cd               numinstratum                chi-sq                dfforchisq                  pvaludforchisq                likelihoodratiochisq           etc etc

1111                                 0                             43208               5.936074278                   1                        0.0148340237                     2.6000184059

2222                                 1                              8465                0.0004668797                 1                        0.9827611316                     0.0004696993

3333                                 2                             43211               2.1302468839                 1                        0.1444174938                     1.2836288201

I am thinking that my likelihood ratio chisq is what I use for the odds ratio for graphin. The National average is 3.69% however I am not positive what to use for the graphing to show the odds ratio. Any advice?

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

In addition to Doc's suggestion, if you have SAS 9.2 or higher, then PROC FREQ can give you an automatic oddsratio plot if you do this:

  TABLES ..... / plots=(oddsratioplot);

in your TABLE request and if ODS GRAPHICS ON; is in effect. So, you might get the plot you want without capturing the OR numbers and plotting them yourself. Look in the FREQ and ODS GRAPHICS doc for more info.

cynthia

View solution in original post

4 REPLIES 4
Doc_Duke
Rhodochrosite | Level 12

I think that you are going to need to use the ODS output facility here.  The OUTPUT statement does not output the OR's for the CMH test; it just works on 2x2 tables (at least per the documentation).

Doc Muhlbaier

Duke

tmm
Fluorite | Level 6 tmm
Fluorite | Level 6


What is the OR's for the CMH test? Does that mean my code is not right so I am not capturing the entire CHISQ test? And if so what do I need to put in and what do I need to get the odds ratio for graphing?

Cynthia_sas
SAS Super FREQ

Hi:

In addition to Doc's suggestion, if you have SAS 9.2 or higher, then PROC FREQ can give you an automatic oddsratio plot if you do this:

  TABLES ..... / plots=(oddsratioplot);

in your TABLE request and if ODS GRAPHICS ON; is in effect. So, you might get the plot you want without capturing the OR numbers and plotting them yourself. Look in the FREQ and ODS GRAPHICS doc for more info.

cynthia

tmm
Fluorite | Level 6 tmm
Fluorite | Level 6

Actually I did not need any altering of my proc freq. I read thru the ODS and proc freq for graphics posted by Cynthia and created a quick proc freq based on what it stated. It gave me an odds ratio for my list and I then went into the readm.final table created by my proc freq chisq statement and looked to see if any of those numbers matched. I have numerous columns and did not post them all in my original because there are too many columns. But one column that is output based on my proc freq is called odds ratio est relative to risk and I viewed the data in there along with the output from the code I ran for the ods graphics on and it matches. So that tells me this column houses my odds ratio that I needed for my graphs.

Thanks

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 4 replies
  • 1184 views
  • 0 likes
  • 3 in conversation