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!
The p-value is in the estimates table.
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
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.
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.
Show your code and output.
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.5198 | 8.7698 | 0.7353 | 0.3912 | |
---|---|---|---|---|---|---|
bptacat | Mild | 1 | 4.9201 | 8.4785 | 0.3368 | 0.5617 |
bptacat | Moderate | 1 | 5.4493 | 8.4785 | 0.4131 | 0.5204 |
bptacat | Profound | 1 | -7.7375 | 31.6642 | 0.0597 | 0.8070 |
bptacat | Severe | 1 | -7.5110 | 14.8127 | 0.2571 | 0.6121 |
age | 1 | -0.0457 | 0.000588 | 6048.8190 | <.0001 | |
RIAGENDR | 2 | 1 | 0.2018 | 0.00182 | 12274.5339 | <.0001 |
dhtn | Yes | 1 | 0.0439 | 0.00184 | 570.7600 | <.0001 |
dstroke | Yes | 1 | 0.7128 | 0.00208 | 117361.331 | <.0001 |
race | Mexican American | 1 | 3.6052 | 2.2411 | 2.5879 | 0.1077 |
race | Non-hispanic Black | 1 | 2.8109 | 2.2411 | 1.5731 | 0.2098 |
race | Other - Including Multiracial | 1 | -11.1484 | 8.9643 | 1.5467 | 0.2136 |
race | Other Hispanic | 1 | 2.2693 | 2.2411 | 1.0254 | 0.3113 |
educ | HS grad | 1 | 0.3007 | 0.00225 | 17917.2131 | <.0001 |
educ | Some college or more | 1 | -0.5879 | 0.00260 | 51011.4087 | <.0001 |
dm | diabetic | 1 | -0.0123 | 0.00193 | 40.8251 | <.0001 |
nfcsmoke | current | 1 | 0.2691 | 0.00313 | 7379.2558 | <.0001 |
nfcsmoke | former | 1 | -0.2601 | 0.00245 | 11235.5209 | <.0001 |
hause | Yes | 1 | -0.4633 | 0.00373 | 15459.4100 | <.0001 |
bptacat Mild vs Normal | 1.042 | 1.034 | 1.049 |
---|---|---|---|
bptacat Moderate vs Normal | 1.769 | 1.751 | 1.786 |
bptacat Profound vs Normal | <0.001 | <0.001 | >999.999 |
bptacat Severe vs Normal | <0.001 | <0.001 | >999.999 |
age | 0.955 | 0.954 | 0.956 |
RIAGENDR 2 vs 1 | 1.497 | 1.486 | 1.508 |
dhtn Yes vs No | 1.092 | 1.084 | 1.100 |
dstroke Yes vs No | 4.160 | 4.127 | 4.195 |
race Mexican American vs Non-hispanic White | 3.134 | 3.101 | 3.167 |
race Non-hispanic Black vs Non-hispanic White | 1.416 | 1.402 | 1.430 |
race Other - Including Multiracial vs Non-hispanic White | <0.001 | <0.001 | >999.999 |
race Other Hispanic vs Non-hispanic White | 0.824 | 0.799 | 0.849 |
educ HS grad vs Less than HS grad | 1.014 | 1.006 | 1.021 |
educ Some college or more vs Less than HS grad | 0.417 | 0.413 | 0.421 |
dm diabetic vs nondiabetic | 0.976 | 0.968 | 0.983 |
nfcsmoke current vs never | 1.321 | 1.308 | 1.333 |
nfcsmoke former vs never | 0.778 | 0.772 | 0.783 |
hause Yes vs No | 0.396 | 0.390 | 0.402 |
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.
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.
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 | NH.DIAUDIOALQ4YRFFQ2YRDEPLIMITED | |
---|---|---|
Response Variable | MajorDepression | |
Number of Response Levels | 2 | |
Weight Variable | wtmec4yr | wtmec4yr |
Model | binary logit | |
Optimization Technique | Fisher's scoring |
Number of Observations Read | 1175 |
---|---|
Number of Observations Used | 955 |
Sum of Weights Read | 16270021 |
Sum of Weights Used | 14184719 |
1 | 1 | 38 | 424187 |
---|---|---|---|
2 | 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 | 1 | 0 | 0 | 0 |
---|---|---|---|---|---|
Moderate | 0 | 1 | 0 | 0 | |
Normal | -1 | -1 | -1 | -1 | |
Profound | 0 | 0 | 1 | 0 | |
Severe | 0 | 0 | 0 | 1 | |
RIAGENDR | 1 | -1 | |||
2 | 1 | ||||
race | Mexican American | 1 | 0 | 0 | 0 |
Non-hispanic Black | 0 | 1 | 0 | 0 | |
Non-hispanic White | -1 | -1 | -1 | -1 | |
Other - Including Multiracial | 0 | 0 | 1 | 0 | |
Other Hispanic | 0 | 0 | 0 | 1 | |
educ | HS grad | 1 | 0 | ||
Less than HS grad | -1 | -1 | |||
Some college or more | 0 | 1 | |||
dhtn | No | -1 | |||
Yes | 1 | ||||
dstroke | No | -1 | |||
Yes | 1 | ||||
dm | diabetic | 1 | |||
nondiabetic | -1 | ||||
nfcsmoke | current | 1 | 0 | ||
former | 0 | 1 | |||
never | -1 | -1 | |||
hause | No | -1 | |||
Yes | 1 |
Convergence criterion (GCONV=1E-8) satisfied. |
AIC | 3813142.2 | 3495939.9 |
---|---|---|
SC | 3813147.0 | 3496032.3 |
-2 Log L | 3813140.2 | 3495901.9 |
Likelihood Ratio | 317238.268 | 18 | <.0001 |
---|---|---|---|
Score | 366764.970 | 18 | <.0001 |
Wald | 304524.605 | 18 | <.0001 |
bptacat | 4 | 14514.4119 | <.0001 |
---|---|---|---|
age | 1 | 6048.8190 | <.0001 |
RIAGENDR | 1 | 12274.5339 | <.0001 |
dhtn | 1 | 570.7600 | <.0001 |
dstroke | 1 | 117361.331 | <.0001 |
race | 4 | 46042.7111 | <.0001 |
educ | 2 | 51550.2043 | <.0001 |
dm | 1 | 40.8251 | <.0001 |
nfcsmoke | 2 | 11605.2709 | <.0001 |
hause | 1 | 15459.4100 | <.0001 |
Intercept | 1 | -7.5198 | 8.7698 | 0.7353 | 0.3912 | |
---|---|---|---|---|---|---|
bptacat | Mild | 1 | 4.9201 | 8.4785 | 0.3368 | 0.5617 |
bptacat | Moderate | 1 | 5.4493 | 8.4785 | 0.4131 | 0.5204 |
bptacat | Profound | 1 | -7.7375 | 31.6642 | 0.0597 | 0.8070 |
bptacat | Severe | 1 | -7.5110 | 14.8127 | 0.2571 | 0.6121 |
age | 1 | -0.0457 | 0.000588 | 6048.8190 | <.0001 | |
RIAGENDR | 2 | 1 | 0.2018 | 0.00182 | 12274.5339 | <.0001 |
dhtn | Yes | 1 | 0.0439 | 0.00184 | 570.7600 | <.0001 |
dstroke | Yes | 1 | 0.7128 | 0.00208 | 117361.331 | <.0001 |
race | Mexican American | 1 | 3.6052 | 2.2411 | 2.5879 | 0.1077 |
race | Non-hispanic Black | 1 | 2.8109 | 2.2411 | 1.5731 | 0.2098 |
race | Other - Including Multiracial | 1 | -11.1484 | 8.9643 | 1.5467 | 0.2136 |
race | Other Hispanic | 1 | 2.2693 | 2.2411 | 1.0254 | 0.3113 |
educ | HS grad | 1 | 0.3007 | 0.00225 | 17917.2131 | <.0001 |
educ | Some college or more | 1 | -0.5879 | 0.00260 | 51011.4087 | <.0001 |
dm | diabetic | 1 | -0.0123 | 0.00193 | 40.8251 | <.0001 |
nfcsmoke | current | 1 | 0.2691 | 0.00313 | 7379.2558 | <.0001 |
nfcsmoke | former | 1 | -0.2601 | 0.00245 | 11235.5209 | <.0001 |
hause | Yes | 1 | -0.4633 | 0.00373 | 15459.4100 | <.0001 |
bptacat Mild vs Normal | 1.042 | 1.034 | 1.049 |
---|---|---|---|
bptacat Moderate vs Normal | 1.769 | 1.751 | 1.786 |
bptacat Profound vs Normal | <0.001 | <0.001 | >999.999 |
bptacat Severe vs Normal | <0.001 | <0.001 | >999.999 |
age | 0.955 | 0.954 | 0.956 |
RIAGENDR 2 vs 1 | 1.497 | 1.486 | 1.508 |
dhtn Yes vs No | 1.092 | 1.084 | 1.100 |
dstroke Yes vs No | 4.160 | 4.127 | 4.195 |
race Mexican American vs Non-hispanic White | 3.134 | 3.101 | 3.167 |
race Non-hispanic Black vs Non-hispanic White | 1.416 | 1.402 | 1.430 |
race Other - Including Multiracial vs Non-hispanic White | <0.001 | <0.001 | >999.999 |
race Other Hispanic vs Non-hispanic White | 0.824 | 0.799 | 0.849 |
educ HS grad vs Less than HS grad | 1.014 | 1.006 | 1.021 |
educ Some college or more vs Less than HS grad | 0.417 | 0.413 | 0.421 |
dm diabetic vs nondiabetic | 0.976 | 0.968 | 0.983 |
nfcsmoke current vs never | 1.321 | 1.308 | 1.333 |
nfcsmoke former vs never | 0.778 | 0.772 | 0.783 |
hause Yes vs No | 0.396 | 0.390 | 0.402 |
Percent Concordant | 67.4 | Somers' D | 0.371 |
---|---|---|---|
Percent Discordant | 30.4 | Gamma | 0.379 |
Percent Tied | 2.2 | Tau-a | 0.028 |
Pairs | 34846 | c | 0.685 |
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
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 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.