07242016 08:02 PM
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;
07242016 10:12 PM
I don't know the answer to that, someone else will have to chime in now.
Cheers!
07242016 08:09 PM
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;
07242016 08:20 PM
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.
07242016 08:29 PM
Change clodds to Wald or remove it.
Please post
1) log from code
2) parameter estimate table
07242016 09:12 PM
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 nonexact 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

07242016 09:50 PM
LOG?
07242016 09:53 PM
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=1E8) 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
07242016 09:55 PM
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.
07242016 09:53 PM
So I got some sample data and replicated your code. My log says this:
class CMV_ca_2_1 (ref='Absent')/param=ref;
07242016 10:06 PM
Thanks Reeza; it worked this time.
Both tables are below, exact and nonexact 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  Twosided pValue  
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 
07242016 10:12 PM
I don't know the answer to that, someone else will have to chime in now.
Cheers!
07252016 02:45 AM
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 22322: Syntax error, expecting one of the following: ;, CODING, CPREFIX, DESC,
DESCENDING, LPREFIX, MISSING, ORDER, PARAM, REF, REFERENCE, TRUNCATE.
ERROR 76322: 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;
07252016 02:49 AM
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 😉
07252016 02:51 AM
07252016 02:52 AM
It did not change putting Param=ref once.
Problem remians the same.
Need further help from the community? Please ask a new question.