Hi,
I am trying to apply exact conditional logistic regression to my samll sample matched data with th efollowing code but t does not give me odds ratio. It gives coefficients with their CI.
Can yo ucorrect my code? Thanks
proc logistic data=pe.matchedata_21 desc;
strata group;
class CMV_ca_2_1 (ref='Absent');
format CMV_ca_2_1 CMV_igg.;
model PEstatus (event='1')= CMV_ca_2_1;
exact CMV_ca_2_1 / estimate = both;
run;
I don't know the answer to that, someone else will have to chime in now.
Cheers!
Use an explicit ODDSRATIO statement or use the EXPB option in the model statement.
proc logistic data=pe.matchedata_21 desc;
strata group;
class CMV_ca_2_1 (ref='Absent');
format CMV_ca_2_1 CMV_igg.;
model PEstatus (event='1')= CMV_ca_2_1/ expb clodds=both;
exact CMV_ca_2_1 / estimate = both;
oddsratio cm_ca_2_1;
run;
Thanks Reeza. However, it does not work. With 'oddsratio cmv_ca_2_1' no change.
With 'expb clodds=both' it even does not work; log states '
ERROR: The CLODDS=PL option is not allowed when a STRATA statement is specified.
Change clodds to Wald or remove it.
Please post
1) log from code
2) parameter estimate table
proc logistic data=pe.matchedata_21 desc;
strata group;
class CMV_ca_2_1 (ref='Absent');
format CMV_ca_2_1 CMV_igg.;
model PEstatus (event='1')= CMV_ca_2_1;
exact CMV_ca_2_1 / estimate = both;
oddsratio cmv_ca_2_1;
run;
Below is the table which I get for Exact analysis after using the above code. PLease note that before this table or exact analysis, the result contains non-exact output with 95%CI (output 1 below).
SAS Output 1
2.386 | 0.374 | 15.232 |
SAS Output 2
0.4348 | 0.4729 | -0.6886 | 1.7146 | 0.6250
|
LOG?
My apologies!
81 proc logistic data=pe.matchedata_21 desc;
NOTE: Data file PE.MATCHEDATA_21.DATA is in a format that is native to another host, or
the file encoding does not match the session encoding. Cross Environment Data
Access will be used, which might require additional CPU resources and might reduce
performance.
82 strata group;
83 class CMV_ca_2_1 (ref='Absent');
84 format CMV_ca_2_1 CMV_igg.;
85 model PEstatus (event='1')= CMV_ca_2_1;
86 exact CMV_ca_2_1 / estimate = both;
87 oddsratio cmv_ca_2_1;
88 run;
NOTE: Writing HTML Body file: sashtml1.htm
NOTE: PROC LOGISTIC is modeling the probability that PEstatus='1'.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
WARNING: Odds ratios for CMV_ca_2_1 in the EXACT statement are not computed unless the
reference parameterization is used.
NOTE: There were 73 observations read from the data set PE.MATCHEDATA_21.
NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 2.08 seconds
cpu time 1.37 seconds
PLEASE read the log in the future and post it in your question if you have issues.
It tells you exactly what you need to do to solve your issue.
@wajmsu wrote:
WARNING: Odds ratios for CMV_ca_2_1 in the EXACT statement are not computed unless the
reference parameterization is used.
So I got some sample data and replicated your code. My log says this:
class CMV_ca_2_1 (ref='Absent')/param=ref;
Thanks Reeza; it worked this time.
Both tables are below, exact and non-exact analysis.
My question is that why we use exact when we get wide 95%CI, usually we prefer narrow CI.
Exact Odds Ratios | |||||
Parameter |
| Estimate | 95% Confidence Limits | Two-sided p-Value | |
CMV_ca_2_1 | Present | 2.386 | 0.252 | 30.852 | 0.6250 |
Odds Ratio Estimates | |||
Effect | Point Estimate | 95% Wald | |
CMV_ca_2_1 Present vs Absent | 2.386 | 0.374 | 15.232 |
I don't know the answer to that, someone else will have to chime in now.
Cheers!
Hi again Reeza,
As I start buidling multivariable model it again creates problem. Here are my codes and logs, once again thanks for your help.
proc logistic data=pe.matchedata_21 desc;
strata group;
class CMV_ca_2_1 (ref='Absent')/param=ref bmicat (ref='Less than 25')/param=ref;
format CMV_ca_2_1 CMV_igg. bmicat bmicat.;
model PEstatus (event='1')= CMV_ca_2_1 bmicat;
exact CMV_ca_2_1 bmicat / estimate = both;
oddsratio cmv_ca_2_1 bmicat;
run;
153 proc logistic data=pe.matchedata_21 desc;
NOTE: Data file PE.MATCHEDATA_21.DATA is in a format that is native to another host, or
the file encoding does not match the session encoding. Cross Environment Data
Access will be used, which might require additional CPU resources and might reduce
performance.
NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
NOTE: The SAS System stopped processing this step because of errors.
154 strata group;
155 class CMV_ca_2_1 (ref='Absent')/param=ref bmicat (ref='Less than 25')/param=ref;
------
22
76
ERROR 22-322: Syntax error, expecting one of the following: ;, CODING, CPREFIX, DESC,
DESCENDING, LPREFIX, MISSING, ORDER, PARAM, REF, REFERENCE, TRUNCATE.
ERROR 76-322: Syntax error, statement will be ignored.
156 format CMV_ca_2_1 CMV_igg. bmicat bmicat.;
157 model PEstatus (event='1')= CMV_ca_2_1 bmicat;
158 exact CMV_ca_2_1 bmicat / estimate = both;
159 oddsratio cmv_ca_2_1 bmicat;
160 run;
Param=ref is only specified only once at the end of your class statement.
If you really want multiple methods you can use multiple class statements.
In this case the error isn't very helpful 😉
It did not change putting Param=ref once.
Problem remians the same.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.