I am trying to obtain crude OR and their relevant CIs for several variable using the procfreq tables function; however, the statement is not giving me odds ratios.
Proc Freq data=df_epi ;
tables age * Stroke / cmh;
run;
I obtained the adjusted OR using this code.
Proc Logistic data=df_epi;
class educ ;
model Stroke (Event='1') = educ Age bmi diabetes prevchd prevhyp sysbp diabp glucose totchol heartrte;
run;
Help please
@deme_bb wrote:
What do you mean by "fix the class statement"?
Not sure how familiar you are with PROC LOGISTIC and logistic regression, but you may also want to specify PARAM=REF on the CLASS statement to get referential parameterization of your dummy variables, the default is GLM.
SO my unadjusted odds ratio would be me running that statement with each individual variable separately?
. So if you run a logistic regression with a single variable that would be the crude rate.
From the documentation:
Requests all Cochran-Mantel-Haenszel statistics |
|
Requests CMH correlation statistic, adjusted odds ratios, |
|
and adjusted relative risks |
|
Requests CMH correlation and row mean scores (ANOVA) |
|
statistics, adjusted odds ratios, and adjusted relative risks |
or
Requests the odds ratio for tables |
You haven't used an option that would provide OR, change your code by adding one of the following options instead and see if you get what you need.
If your table is not a 2x2 table, this gets a bit trickier and you're likely better off just using PROC LOGISTIC to get the unadjusted rates.
Not sure how familiar you are with PROC LOGISTIC and logistic regression, but you may also want to specify PARAM=REF on the CLASS statement to get referential parameterization of your dummy variables, the default is GLM.
@deme_bb wrote:
I am trying to obtain crude OR and their relevant CIs for several variable using the procfreq tables function; however, the statement is not giving me odds ratios.
Proc Freq data=df_epi ;
tables age * Stroke / cmh;
run;
I obtained the adjusted OR using this code.
Proc Logistic data=df_epi;
class educ ;
model Stroke (Event='1') = educ Age bmi diabetes prevchd prevhyp sysbp diabp glucose totchol heartrte;
run;
Help please
Hi Reeza,
My table is not a 2x2. Proc logistic would only give me the adjusted ratios correct? If it doe sindeed give me crude ratios im not sure on how to go about obtaining them.
Okay so maybe i have it backwards. How would i determine my adjusted ratios?
The code below is the code i used to obtain the unadjusted ratios:
Proc Logistic data=df_epi;
class educ ;
model Stroke (Event='1') = educ Age bmi diabetes prevchd prevhyp sysbp diabp glucose totchol heartrte;
run;
So how would i obtain the adjusted ratios?
What do you mean by "fix the class statement"?
SO my unadjusted odds ratio would be me running that statement with each individual variable separately?
@deme_bb wrote:
What do you mean by "fix the class statement"?
Not sure how familiar you are with PROC LOGISTIC and logistic regression, but you may also want to specify PARAM=REF on the CLASS statement to get referential parameterization of your dummy variables, the default is GLM.
SO my unadjusted odds ratio would be me running that statement with each individual variable separately?
. So if you run a logistic regression with a single variable that would be the crude rate.
Thank you so much!
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.