BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
amannelli
Calcite | Level 5

Good morning. 

 

I used the EXACT  statement in logistic regression to analyse data with quasi complete separation  of results (none of the individuals in the unexposed group was a case). I obtained the median unbiased estimate of the logistic regression parameter. The exact p value was 0.062 but the parameter 95% CL's were 0.18; Infinity. When calculating the odds ratio, the lower limit was greater than 1 (1.2). Furhermore, very disturbingly, after including the ONESIDED option in the EXACT statement, while the p-value was reduce by half, the 95% CL's of the same OR were not changed. 

Thank you very much for your help 

 

Alessandro Mannelli 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

You didn't say which release you are using, but in the current release, SAS 9.4 TS1M7, the p-value reported for riskfact2 is 0.0277 with confidence interval (0.2147, inf) and these are the same regardless of the ONESIDED option. This is because that estimate is a median unbiased estimate. The confidence interval for its odds ratio is (1.240, inf) and again is unchanged by the ONESIDED option.

 

You should carefully read the ending part of the "Details:Exact conditional logistic regression" in the documentation of the current SAS release. There it tells you that for a median unbiased estimate, the p-value is always a one-sided p-value. Since riskfact1 is not a median unbiased estimate, its p-value (0.0021) is a two-sided p-value, and with the ONESIDED option, the one-sided p-value is 0.0011.

View solution in original post

9 REPLIES 9
ballardw
Super User

AS an absolute minimum you should show your code. Then we at least have a chance to see the possible effects of options.

Better would be to provide the diagnostic summaries and the actual output along with the code and possibly the log.

 

Code is needed because just Proc Logistic has 20+ statements that interact. Plus Proc Logistic is not the only procedure that can perform logistic regression.

 

Code and log entries are best posted into text boxes opened on the the forum with the </> icon to preserve text positions. The message windows will reformat text.

amannelli
Calcite | Level 5
Good morning, I placed another post with datalines and codes, for the one
dataset where I can have data in binomial format (pos / tot), just in case,
I paste the same codes here. Sorry in case of double posting!! and thank
you very much. I have been a sas user for 30 years but never used this
support...

data risk;

input riskfact1 riskfact2 tot pos;

datalines;

0 0 36 0

0 1 93 3

1 0 13 0

1 1 54 11

;

run;



proc logistic data=risk exactonly;

TITLE ' two-sided ';

title2 'Conflicting 95% CLs and exact p-value';

model pos / tot = riskfact1 riskfact2;

exact riskfact1 riskfact2 / estimate=both outdist = dist;

run;



proc logistic data=risk exactonly;

TITLE ' one-sided ';

title2 ' 95% CLs not affected by onesided option';

model pos / tot = riskfact1 riskfact2;

exact riskfact1 riskfact2 / estimate=both outdist = dist
onesided;
run;




sbxkoenk
SAS Super FREQ

Hello,

 

I haven't looked at your code (yet).

But next time you provide code (I tell it as you indicate you are new to this forum), use the 'Insert SAS Code' button (the running man in a square) on the toolbar beneath the string 'Body'. 

That way your code preserves structure and formatting and there's some useful highlighting and colors. And it's much more dense.

 

Cheers,

Koen

amannelli
Calcite | Level 5

Good morning.    I used the EXACT  statement in logistic regression to analyse data with quasi complete separation  of results (none of the individuals in the unexposed group was a case). I obtained the median unbiased estimate of the logistic regression parameter. The exact p value was 0.055 but the parameter 95% CL's were 0.18; Infinity. When calculating the odds ratio, the lower limit was greater than 1 (1.24). Furhermore, very disturbingly, after including the ONESIDED option in the EXACT statement, while the p-value was reduce by half, the 95% CL's of the same OR were not changed. 

I paste here codes including datalines: 95% CL and exact p value for riskfactor2 are conflicting, furthermore, CL are not affected by onesided option (p-value is)

 

data risk;
input riskfact1 riskfact2 tot pos;
datalines;
0 0 36 0
0 1 93 3
1 0 13 0
1 1 54 11
;
run;

proc logistic data=risk exactonly;
TITLE ' two-sided ';
title2 'Conflicting 95% CLs and exact p-value';
model pos / tot = riskfact1 riskfact2;
exact riskfact1 riskfact2 / estimate=both outdist = dist;
run;

proc logistic data=risk exactonly;
TITLE ' one-sided ';
title2 ' 95% CLs not affected by onesided option';
model pos / tot = riskfact1 riskfact2;
exact riskfact1 riskfact2 / estimate=both outdist = dist onesided;
run;

 

Thank you very much for your help    Alessandro Mannelli 

sbxkoenk
SAS Super FREQ

Hello,

 

Only the Exact Odds Ratios for 'riskfact2' are identical in both outputs (logistic1 and logistic2), and that makes sense as the first output clearly mentions:

Note: * indicates a median unbiased estimate and a one-sided p-value. 

 

Also, have a look at this paper:

Paper 3018-2019
Predicting Inside the Dead Zone of Complete Separation in Logistic Regression
Robert Derr, SAS Institute Inc., Cary, NC

https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3018-2019.pdf

 

Cheers,

Koen

amannelli
Calcite | Level 5
Thank you very much. My problem, however, is that the exact p value is = 0.055 (p>0.05, accept the null hypothesis) whereas the 95% CI lower limit of the odds ratio is 1.24 (being > 1 I would reject the null hypothesis)

second, I realise that the ONESIDED option only affects the exact pa value, not the 95% CL's since they are the same as in the two-sided defalt for riskfactor2

Thank you and best regrds
sbxkoenk
SAS Super FREQ

On top of my previous response.

 

Also have a look at this communities entry:

Extrem odd ratio with firth logistic regression
https://communities.sas.com/t5/Statistical-Procedures/Extrem-odd-ratio-with-firth-logistic-regressio...

 

Koen

StatDave
SAS Super FREQ

You didn't say which release you are using, but in the current release, SAS 9.4 TS1M7, the p-value reported for riskfact2 is 0.0277 with confidence interval (0.2147, inf) and these are the same regardless of the ONESIDED option. This is because that estimate is a median unbiased estimate. The confidence interval for its odds ratio is (1.240, inf) and again is unchanged by the ONESIDED option.

 

You should carefully read the ending part of the "Details:Exact conditional logistic regression" in the documentation of the current SAS release. There it tells you that for a median unbiased estimate, the p-value is always a one-sided p-value. Since riskfact1 is not a median unbiased estimate, its p-value (0.0021) is a two-sided p-value, and with the ONESIDED option, the one-sided p-value is 0.0011.

amannelli
Calcite | Level 5

Thank you very much StatDave_sas, 

 

Now I understand that the ONESIDED option affected the p-value, but not the 95% CL, which is one-side even when such an option is not included. 

 

Best regards

 

Alessandro Mannelli 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

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.

Discussion stats
  • 9 replies
  • 1439 views
  • 2 likes
  • 4 in conversation