## Odds Ratio Proc Logistic Question

Occasional Contributor
Posts: 6

# Odds Ratio Proc Logistic Question

I am running several proc logistic models, utilizing the odds ratio estimates. Although SAS will produce the point estimate, and 95% wald confidence limits, I can not figure out the code for SAS to give me the p value for each point estimate in the odds ratios. Any suggestions? Thanks again!

Super User
Posts: 20,785

## Re: Odds Ratio Proc Logistic Question

The p-value is in the estimates table.

Occasional Contributor
Posts: 6

## Re: Odds Ratio Proc Logistic Question

I don't think I am being as clear as I should. In the odds ratio tables I have generated from the Proc Logistic, I have asked sas in the original logistic model to compare (example: men, vs women) or diabetic vs non-diabetic. The estimates table does not give these comparisons  as displayed in the odds ratio table.

Is that a little clearer? Thanks again for your help. ~Dave

Super User
Posts: 20,785

## Re: Odds Ratio Proc Logistic Question

Where do odds ratio come from? They are calculated from the parameter estimates, exp(estimate) equal the odds ratio.  Therefore p-value's are the same.

If the estimates aren't the comparison you're trying to make you can change your reference levels.

Occasional Contributor
Posts: 6

## Re: Odds Ratio Proc Logistic Question

Perhaps then my question is more of an understanding of SAS output. What's the reason that the PR > chisq in the parameter estimates value would be non-significant (ex: p 0.77) but the 95% wald confidence limits for the odd ratios is greater than 1 (ex: point estimate 1.023, 95% CI 1.018-1.028) for both the lower and upper limit. THe later for me seems to imply that the comparison is significant. thanks again for your help.

Super User
Posts: 20,785

## Re: Odds Ratio Proc Logistic Question

Occasional Contributor
Posts: 6

## Re: Odds Ratio Proc Logistic Question

Code:

Proc Logistic data=NH.DiAudioALQ4YrFFQ2YrDepLimited descending;

class bptacat (ref='normal') riagendr (ref='1') race (ref='Non-hispanic White') educ (ref='Less than HS grad') dhtn (ref='No') dstroke (ref='No') dm (ref='nondiabetic') nfcsmoke (ref='never') hause (ref='No');

Model MajorDepression=bptacat riagendr age dhtn dstroke race educ dm nfcsmoke hause;

Weight wtmec4yr;

run;

Analysis of Maximum LIkelihood Estimates

Parameter                                 Df   Estimate  SE        Wald Chi-Sq   Pr> Chisq

 Intercept bptacat Mild bptacat 1 -7.5198 8.7698 0.7353 0.3912 1 4.9201 8.4785 0.3368 0.5617 1 5.4493 8.4785 0.4131 0.5204 1 -7.7375 31.6642 0.0597 0.8070 1 -7.511 14.8127 0.2571 0.6121 1 -0.0457 0.000588 6048.82 <.0001 1 0.2018 0.00182 12274.5 <.0001 1 0.0439 0.00184 570.76 <.0001 1 0.7128 0.00208 117361 <.0001 1 3.6052 2.2411 2.5879 0.1077 1 2.8109 2.2411 1.5731 0.2098 1 -11.1484 8.9643 1.5467 0.2136 1 2.2693 2.2411 1.0254 0.3113 1 0.3007 0.00225 17917.2 <.0001 1 -0.5879 0.0026 51011.4 <.0001 1 -0.0123 0.00193 40.8251 <.0001 1 0.2691 0.00313 7379.26 <.0001 1 -0.2601 0.00245 11235.5 <.0001 1 -0.4633 0.00373 15459.4 <.0001

Odds Ratio Estimates
bptacat Mild vs Normal bptacat Moderate vs Normal bptacat Profound vs Normal 1.042 1.034 1.049 1.769 1.751 1.786 <0.001 <0.001 >999.999 <0.001 <0.001 >999.999 0.955 0.954 0.956 1.497 1.486 1.508 1.092 1.084 1.100 4.160 4.127 4.195 3.134 3.101 3.167 1.416 1.402 1.430 <0.001 <0.001 >999.999 0.824 0.799 0.849 1.014 1.006 1.021 0.417 0.413 0.421 0.976 0.968 0.983 1.321 1.308 1.333 0.778 0.772 0.783 0.396 0.390 0.402

Occasional Contributor
Posts: 6

## Re: Odds Ratio Proc Logistic Question

an example would be bptacat for mild: p value in estimate is 0.5617, but the 95% CI for mild vs normal is greater than 1, implying significance.

Super User
Posts: 20,785

## Re: Odds Ratio Proc Logistic Question

There's also this little annoying note in the docs:

CautionROC LOGISTIC does not compute the proper variance estimators if you are analyzing survey data and specifying the sampling weights through the WEIGHT statement. The SURVEYLOGISTIC procedure is designed to perform the necessary, and correct, computations.

Occasional Contributor
Posts: 6

## Re: Odds Ratio Proc Logistic Question

Here's the rest of the output

Any thoughts? I don't think a param=ref is necessary since I have asked sas to compute the model descending and have specified the reference for each variable in the class statement, however, i am still very new at this, so please correct me if i am at all mistaken or making assumptions. thanks again for your help.

The LOGISTIC Procedure

Data Set Response Variable NH.DIAUDIOALQ4YRFFQ2YRDEPLIMITED MajorDepression 2 wtmec4yr wtmec4yr binary logit Fisher's scoring

 Number of Observations Read 1175 955 16270021 14184719

 1 2 1 38 424187 0 917 13760531

Probability modeled is MajorDepression=1.

 Note: 220 observations were deleted due to missing values for the response or explanatory variables.

 bptacat Mild Moderate 1 0 0 0 0 1 0 0 -1 -1 -1 -1 0 0 1 0 0 0 0 1 -1 1 1 0 0 0 0 1 0 0 -1 -1 -1 -1 0 0 1 0 0 0 0 1 1 0 -1 -1 0 1 -1 1 -1 1 1 -1 1 0 0 1 -1 -1 -1 1

 Convergence criterion (GCONV=1E-8) satisfied.

 AIC SC 3.81314e+06 3.49594e+06 3.81315e+06 3.49603e+06 3.81314e+06 3.4959e+06

 Likelihood Ratio Score Wald 317238 18 <.0001 366765 18 <.0001 304525 18 <.0001

 bptacat age RIAGENDR 4 14514.4 <.0001 1 6048.82 <.0001 1 12274.5 <.0001 1 570.76 <.0001 1 117361 <.0001 4 46042.7 <.0001 2 51550.2 <.0001 1 40.8251 <.0001 2 11605.3 <.0001 1 15459.4 <.0001

Likelihood estimates
 Intercept bptacat Mild bptacat 1 -7.5198 8.7698 0.7353 0.3912 1 4.9201 8.4785 0.3368 0.5617 1 5.4493 8.4785 0.4131 0.5204 1 -7.7375 31.6642 0.0597 0.8070 1 -7.511 14.8127 0.2571 0.6121 1 -0.0457 0.000588 6048.82 <.0001 1 0.2018 0.00182 12274.5 <.0001 1 0.0439 0.00184 570.76 <.0001 1 0.7128 0.00208 117361 <.0001 1 3.6052 2.2411 2.5879 0.1077 1 2.8109 2.2411 1.5731 0.2098 1 -11.1484 8.9643 1.5467 0.2136 1 2.2693 2.2411 1.0254 0.3113 1 0.3007 0.00225 17917.2 <.0001 1 -0.5879 0.0026 51011.4 <.0001 1 -0.0123 0.00193 40.8251 <.0001 1 0.2691 0.00313 7379.26 <.0001 1 -0.2601 0.00245 11235.5 <.0001 1 -0.4633 0.00373 15459.4 <.0001

Odds Ratio Estimates with Confidence Intervals
bptacat Mild vs Normal bptacat Moderate vs Normal bptacat Profound vs Normal 1.042 1.034 1.049 1.769 1.751 1.786 <0.001 <0.001 >999.999 <0.001 <0.001 >999.999 0.955 0.954 0.956 1.497 1.486 1.508 1.092 1.084 1.100 4.160 4.127 4.195 3.134 3.101 3.167 1.416 1.402 1.430 <0.001 <0.001 >999.999 0.824 0.799 0.849 1.014 1.006 1.021 0.417 0.413 0.421 0.976 0.968 0.983 1.321 1.308 1.333 0.778 0.772 0.783 0.396 0.390 0.402

 Percent Concordant Somers' D 67.4 0.371 30.4 0.379 2.2 0.028 34846 0.685

Super User
Posts: 20,785

## Re: Odds Ratio Proc Logistic Question

It is necessary.  Look at your design matrix, after

Note:220 observations were deleted due to missing values for the response or explanatory variables.

Note the 1 vs -1 for the parametrization, rather than what you'd expect. Anyways, I think the issue is with the weights statement instead (see last message).Try surveylogistic instead of proc logistic

Super User
Posts: 20,785

## Re: Odds Ratio Proc Logistic Question

You need to add param=ref to the class statement to get reference coding, otherwise you have effect coding.

I don't know if that's the issue though...can you post the output from adding that.

Proc Logistic data=NH.DiAudioALQ4YrFFQ2YrDepLimited descending;

class bptacat (ref='normal') riagendr (ref='1') race (ref='Non-hispanic White') educ (ref='Less than HS grad') dhtn (ref='No') dstroke (ref='No') dm (ref='nondiabetic') nfcsmoke (ref='never') hause (ref='No')/param=ref;

Model MajorDepression=bptacat riagendr age dhtn dstroke race educ dm nfcsmoke hause;

Weight wtmec4yr;

run;

Discussion stats
• 11 replies
• 1202 views
• 0 likes
• 2 in conversation