BookmarkSubscribeRSS Feed
david_mener_gmail_com
Calcite | Level 5

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!

11 REPLIES 11
Reeza
Super User

The p-value is in the estimates table.

david_mener_gmail_com
Calcite | Level 5

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

Reeza
Super User

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.

david_mener_gmail_com
Calcite | Level 5

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.

Reeza
Super User

Show your code and output.

david_mener_gmail_com
Calcite | Level 5

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 1-7.51988.76980.73530.3912
bptacatMild14.92018.47850.33680.5617
bptacatModerate15.44938.47850.41310.5204
bptacatProfound1-7.737531.66420.05970.8070
bptacatSevere1-7.511014.81270.25710.6121
age 1-0.04570.0005886048.8190<.0001
RIAGENDR210.20180.0018212274.5339<.0001
dhtnYes10.04390.00184570.7600<.0001
dstrokeYes10.71280.00208117361.331<.0001
raceMexican American13.60522.24112.58790.1077
raceNon-hispanic Black12.81092.24111.57310.2098
raceOther - Including Multiracial1-11.14848.96431.54670.2136
raceOther Hispanic12.26932.24111.02540.3113
educHS grad10.30070.0022517917.2131<.0001
educSome college or more1-0.58790.0026051011.4087<.0001
dmdiabetic1-0.01230.0019340.8251<.0001
nfcsmokecurrent10.26910.003137379.2558<.0001
nfcsmokeformer1-0.26010.0024511235.5209<.0001
hauseYes1-0.46330.0037315459.4100<.0001

       Odds Ratio Estimates
bptacat Mild vs Normal1.0421.0341.049
bptacat Moderate vs Normal1.7691.7511.786
bptacat Profound vs Normal<0.001<0.001>999.999
bptacat Severe vs Normal<0.001<0.001>999.999
age0.9550.9540.956
RIAGENDR 2 vs 11.4971.4861.508
dhtn Yes vs No1.0921.0841.100
dstroke Yes vs No4.1604.1274.195
race Mexican American vs Non-hispanic White3.1343.1013.167
race Non-hispanic Black vs Non-hispanic White1.4161.4021.430
race Other - Including Multiracial vs Non-hispanic White<0.001<0.001>999.999
race Other Hispanic vs Non-hispanic White0.8240.7990.849
educ HS grad vs Less than HS grad1.0141.0061.021
educ Some college or more vs Less than HS grad0.4170.4130.421
dm diabetic vs nondiabetic0.9760.9680.983
nfcsmoke current vs never1.3211.3081.333
nfcsmoke former vs never0.7780.7720.783
hause Yes vs No0.3960.3900.402

david_mener_gmail_com
Calcite | Level 5

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.

Reeza
Super User

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

Caution:PROC 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.

david_mener_gmail_com
Calcite | Level 5

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 SetNH.DIAUDIOALQ4YRFFQ2YRDEPLIMITED
Response VariableMajorDepression
Number of Response Levels2
Weight Variablewtmec4yrwtmec4yr
Modelbinary logit
Optimization TechniqueFisher's scoring

    
Number of Observations Read1175
Number of Observations Used955
Sum of Weights Read16270021
Sum of Weights Used14184719

      
1138424187
2091713760531


Probability modeled is MajorDepression=1.

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

        
bptacatMild1000
Moderate0100
Normal-1-1-1-1
Profound0010
Severe0001
RIAGENDR1-1
21
raceMexican American1000
Non-hispanic Black0100
Non-hispanic White-1-1-1-1
Other - Including Multiracial0010
Other Hispanic0001
educHS grad10
Less than HS grad-1-1
Some college or more01
dhtnNo-1
Yes1
dstrokeNo-1
Yes1
dmdiabetic1
nondiabetic-1
nfcsmokecurrent10
former01
never-1-1
hauseNo-1
Yes1

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

     
AIC3813142.23495939.9
SC3813147.03496032.3
-2 Log L3813140.23495901.9

      
Likelihood Ratio317238.26818<.0001
Score366764.97018<.0001
Wald304524.60518<.0001

       
bptacat414514.4119<.0001
age16048.8190<.0001
RIAGENDR112274.5339<.0001
dhtn1570.7600<.0001
dstroke1117361.331<.0001
race446042.7111<.0001
educ251550.2043<.0001
dm140.8251<.0001
nfcsmoke211605.2709<.0001
hause115459.4100<.0001

Likelihood estimates          
Intercept 1-7.51988.76980.73530.3912
bptacatMild14.92018.47850.33680.5617
bptacatModerate15.44938.47850.41310.5204
bptacatProfound1-7.737531.66420.05970.8070
bptacatSevere1-7.511014.81270.25710.6121
age 1-0.04570.0005886048.8190<.0001
RIAGENDR210.20180.0018212274.5339<.0001
dhtnYes10.04390.00184570.7600<.0001
dstrokeYes10.71280.00208117361.331<.0001
raceMexican American13.60522.24112.58790.1077
raceNon-hispanic Black12.81092.24111.57310.2098
raceOther - Including Multiracial1-11.14848.96431.54670.2136
raceOther Hispanic12.26932.24111.02540.3113
educHS grad10.30070.0022517917.2131<.0001
educSome college or more1-0.58790.0026051011.4087<.0001
dmdiabetic1-0.01230.0019340.8251<.0001
nfcsmokecurrent10.26910.003137379.2558<.0001
nfcsmokeformer1-0.26010.0024511235.5209<.0001
hauseYes1-0.46330.0037315459.4100<.0001

      Odds Ratio Estimates with Confidence Intervals
bptacat Mild vs Normal1.0421.0341.049
bptacat Moderate vs Normal1.7691.7511.786
bptacat Profound vs Normal<0.001<0.001>999.999
bptacat Severe vs Normal<0.001<0.001>999.999
age0.9550.9540.956
RIAGENDR 2 vs 11.4971.4861.508
dhtn Yes vs No1.0921.0841.100
dstroke Yes vs No4.1604.1274.195
race Mexican American vs Non-hispanic White3.1343.1013.167
race Non-hispanic Black vs Non-hispanic White1.4161.4021.430
race Other - Including Multiracial vs Non-hispanic White<0.001<0.001>999.999
race Other Hispanic vs Non-hispanic White0.8240.7990.849
educ HS grad vs Less than HS grad1.0141.0061.021
educ Some college or more vs Less than HS grad0.4170.4130.421
dm diabetic vs nondiabetic0.9760.9680.983
nfcsmoke current vs never1.3211.3081.333
nfcsmoke former vs never0.7780.7720.783
hause Yes vs No0.3960.3900.402

      
Percent Concordant67.4Somers' D0.371
Percent Discordant30.4Gamma0.379
Percent Tied2.2Tau-a0.028
Pairs34846c0.685

Reeza
Super User

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

Reeza
Super User

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;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 11 replies
  • 3012 views
  • 0 likes
  • 2 in conversation