Programming the statistical procedures from SAS

odds ratio by age category

Accepted Solution Solved
Reply
Contributor
Posts: 53
Accepted Solution

odds ratio by age category

HI,

 

I have used proc freq with cmh chisq and alpha options to generate odds ratio for my data.

 

Now I need to generate by age category.

 

Can I use class statement?

PROC freq data=mydata;

class agec;

tables trt /chisq cmh alpha=0.05;

RUN;

 

is giving me an error.

 

 

Thanks,

Archana


Accepted Solutions
Solution
‎02-29-2016 04:06 PM
SAS Super FREQ
Posts: 3,547

Re: odds ratio by age category

[ Edited ]

Here is the documentation for the FREQ procedure. All the valid syntax is explained. There is not a CLASS statement.

 

You can, however, run stratified analyses by using additional variables on the TABLES statement. Here is an example, also from the documentation.

View solution in original post


All Replies
Solution
‎02-29-2016 04:06 PM
SAS Super FREQ
Posts: 3,547

Re: odds ratio by age category

[ Edited ]

Here is the documentation for the FREQ procedure. All the valid syntax is explained. There is not a CLASS statement.

 

You can, however, run stratified analyses by using additional variables on the TABLES statement. Here is an example, also from the documentation.

Respected Advisor
Posts: 4,751

Re: odds ratio by age category

If you simply want separate tests for each age category, sort your data and use a BY statement.

PG
Respected Advisor
Posts: 2,655

Re: odds ratio by age category

Try

 

PROC freq data=mydata;
tables agec*trt /chisq cmh alpha=0.05;
RUN;

Steve Denham

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 284 views
  • 0 likes
  • 4 in conversation