Programming the statistical procedures from SAS

small sample conditional logistic

Accepted Solution Solved
Reply
Contributor
Posts: 61
Accepted Solution

small sample conditional logistic

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;


Accepted Solutions
Solution
‎07-24-2016 10:35 PM
Super User
Posts: 18,569

Re: small sample conditional logistic

I don't know the answer to that, someone else will have to chime in now. 
Cheers!

View solution in original post


All Replies
Super User
Posts: 18,569

Re: small sample conditional logistic

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;
Contributor
Posts: 61

Re: small sample conditional logistic

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.

 

Super User
Posts: 18,569

Re: small sample conditional logistic

Change clodds to Wald or remove it. 

 

Please post 

1) log from code

2) parameter estimate table

Contributor
Posts: 61

Re: small sample conditional logistic

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

Odds Ratio Estimates and Wald Confidence Intervals Odds Ratio Estimate 95% Confidence Limits CMV_ca_2_1 Present vs Absent
2.3860.37415.232

SAS Output 2

Exact Parameter Estimates Parameter   Estimate Standard
Error 95% Confidence Limits Two-sided p-Value CMV_ca_2_1 Present
0.43480.4729-0.68861.7146

0.6250

 

Super User
Posts: 18,569

Re: small sample conditional logistic

 

LOG?

 

 

Contributor
Posts: 61

Re: small sample conditional logistic

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

Super User
Posts: 18,569

Re: small sample conditional logistic

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.


 

 

Super User
Posts: 18,569

Re: small sample conditional logistic

So I got some sample data and replicated your code. My log says this:

 

70 proc logistic data = exlogit desc;
71 class female;
72 freq num;
73 model admit = female apcalc;
74 exact female apcalc / estimate = both;
75 run;
 
NOTE: PROC LOGISTIC is modeling the probability that admit=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
WARNING: Odds ratios for female in the EXACT statement are not computed unless the reference parameterization is used.
NOTE: There were 8 observations read from the data set WORK.EXLOGIT.
NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.28 seconds
cpu time 0.21 seconds
 
Once I changed the code to use reference parameterization, it worked. 
I would assume that your log has a similar warning? 
 
 
class CMV_ca_2_1 (ref='Absent')/param=ref;
Contributor
Posts: 61

Re: small sample conditional logistic

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
Confidence Limits

CMV_ca_2_1 Present vs Absent

2.386

0.374

15.232

Solution
‎07-24-2016 10:35 PM
Super User
Posts: 18,569

Re: small sample conditional logistic

I don't know the answer to that, someone else will have to chime in now. 
Cheers!

Contributor
Posts: 61

Re: small sample conditional logistic

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;

Super User
Posts: 18,569

Re: small sample conditional logistic

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 😉

Contributor
Posts: 61

Re: small sample conditional logistic

 
Contributor
Posts: 61

Re: small sample conditional logistic

It did not change putting Param=ref once.

 

Problem remians the same.

☑ This topic is solved.

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

Discussion stats
  • 24 replies
  • 470 views
  • 2 likes
  • 3 in conversation