PROC LOGISTIC automatically provides a table of odds ratio estimates for predictors not involved in interactions or nested effects. A similar table is produced when you specify the CLODDS=WALD option in the MODEL statement. A table of odds ratio estimates for a specific predictor, whether or not it is involved in interactions or nested effects, can also be produced by specifying the predictor in the ODDSRATIO statement. All of these tables provide a point estimate and confidence limits for each odds ratio. If a p-value is needed instead of a confidence interval, it can be obtained in one of the following ways.
Beginning in SAS 9.4 TS1M3, odds ratio estimates and p-values for a predictor can be obtained by adding the ORPVALUE option in the MODEL statement.Note If the predictor is not involved in interactions or nested effects, also add the CLODDS= option in the MODEL statement. If the predictor is involved in interactions or nested effects, add an ODDSRATIO statement. Specifying the ORPVALUE in the MODEL statement adds p-values in the resulting odds ratio table.
The following uses the data in the example titled "Logistic Modeling with Categorical Predictors" in the LOGISTIC documentation. If Treatment were involved in an interaction, it would be necessary to use the ODDSRATIO statement rather than the CLODDS= option. Both are used in the following statements for illustration.
proc logistic data=Neuralgia; class Treatment Sex / param=glm; model Pain = Treatment Sex Age Duration / clodds=wald orpvalue; oddsratio Treatment; run;
The ODDSRATIO statement only provides estimates for the specified predictor. Use additional ODDSRATIO statements to obtain estimates for other predictors. By default, the table produced by the ODDSRATIO statement gives estimates for all pairwise comparisons of Treatment levels. Specify the DIFF=REF option in the ODDSRATIO statement to show only the comparisons with the reference level.
|
The table produced by the CLODDS= option gives estimates for all predictors not involved in interactions or nested effects. For a CLASS predictor like Treatment, it shows only the estimates for each Treatment level compared to the reference level.
|
Prior to SAS 9.4 TS1M3, p-values can be obtained in different ways depending on the type of predictor as described below.
For a categorical predictor specified in the CLASS and MODEL statements, you can use the LSMEANS statement to estimate its odds ratios and obtain the corresponding p-values. In order to use the LSMEANS statement, the categorical predictors in your model must use GLM parameterization (also known as dummy coding). GLM parameterization is specified using the PARAM=GLM option in the CLASS statement. In the LSMEANS statement, use the DIFF and ODDSRATIO options. A confidence interval is included if you also specify the CL option.
proc logistic data=Neuralgia; class Treatment Sex / param=glm; model Pain = Treatment Sex Age Duration; oddsratio Treatment; lsmeans Treatment / diff oddsratio cl; run;
Note that the "Odds Ratio Estimates and Wald Confidence Intervals" table from the ODDSRATIO statement and the "Differences of Treatment Least Squares Means" table from the DIFF option in the LSMEANS statement produce the same odds ratio estimates and confidence limits. The p-values for the Treatment comparisons also appear in the table provided by the DIFF option in the LSMEANS statement.
|
If a continuous predictor is not involved in an interaction or nested effect, then its odds ratio estimate and confidence limits are given in the default odds ratios table or the odds ratio table produced by the CLODDS= option, if specified. If it is involved in an interaction or nested effect, then the ODDSRATIO statement is needed. Unlike the case of a categorical predictor, the LSMEANS statement cannot be used to provide p-values for odds ratios for continuous predictors. The ESTIMATE statement can be used to estimate the odds ratio and obtain the corresponding p-value. However, correctly determining the coefficients needed in the ESTIMATE statement can be difficult in models involving interactions or nested terms. Instead, the following method uses the odds ratio confidence limits to determine the standard error associated with the log of the odds ratio estimate and then uses it to compute the Wald test statistic and p-value. This method can also be used for categorical predictors regardless of their parameterization.
This method can be applied to any of the following odds ratio tables:
Note that this method can not be used to obtain the associated p-values for odds ratios produced by the CLODDS=PL option.
These statements fit a model involving the interaction of the categorical Sex and continuous Age predictors. Since Treatment and Duration are not involved in interactions or nested effects, their odds ratio estimates are provided in the default "Odds Ratio Estimates" table. This table is saved to a data set named OR using the first ODS OUTPUT statement. The ODDSRATIO statement estimates the SEX odds ratio at the mean of Age in the "Odds Ratio Estimates and Wald Confidence Intervals" table. This table is saved to data set ORW by the second ODS OUTPUT statement.
proc logistic data=Neuralgia; class Treatment Sex / param=glm; model Pain = Treatment Duration Sex Age Sex*Age; oddsratio Sex; ods output OddsRatios=or; ods output OddsRatiosWald=orw; run;
|
The following DATA step statements read the data set of saved Treatment and Duration odds ratio estimates (OR) and compute the standard errors of the log odds ratio estimates. The Wald chi-square statistic and its p-value are also computed for each. The results are displayed by PROC PRINT including the odds ratio estimates and confidence limits computed by PROC LOGISTIC as well as the standard errors, chi-square statistics, and p-values computed by the DATA step.
The DATA and PRINT steps below can be used regardless of the type of parameterization specified in the PARAM= option for CLASS predictors or the units in the UNITS statement (if specified). However, if you specify the ALPHA= option in the PROC LOGISTIC statement to change the significance level used for confidence intervals, then specify the same value in the ALPHA= statement in the DATA step below.
data orwp; set or; alpha=.05; stderr=abs(log(uppercl)-log(lowercl)) / (2*probit(1-alpha/2)); wald=(log(oddsratioest)/stderr)**2; p=1-probchi(wald,1); drop alpha; run; proc print data=orwp label noobs; format p pvalue6.; label stderr="Standard Error" wald="Wald Chi-Square" p="Pr > ChiSq"; run;
The resulting table adds the p-values to the "Odds Ratio Estimates" table.
|
The same statements are used again, changing only the data set being read by the SET statement, to compute the p-value for the SEX odds ratio.
data orwp; set orw; alpha=.05; stderr=abs(log(uppercl)-log(lowercl)) / (2*probit(1-alpha/2)); wald=(log(oddsratioest)/stderr)**2; p=1-probchi(wald,1); drop alpha; run; proc print data=orwp label noobs; format p pvalue6.; label stderr="Standard Error" wald="Wald Chi-Square" p="Pr > ChiSq"; run;
The p-value is added to the "Odds Ratio Estimates and Wald Confidence Intervals" table.
|
__________
Note: In Release 9.4 TS1M3, do not use the ORPVALUE option with the CLODDS= option and the default effects parameterization. See this Problem Note.
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | SAS/STAT | Windows 7 Ultimate x64 | ||
Windows 7 Professional x64 | ||||
Windows 7 Ultimate 32 bit | ||||
Windows 7 Professional 32 bit | ||||
Windows 7 Home Premium x64 | ||||
Windows 7 Enterprise x64 | ||||
Windows 7 Home Premium 32 bit | ||||
Windows 7 Enterprise 32 bit | ||||
Microsoft Windows Server 2012 Std | ||||
Microsoft Windows XP Professional | ||||
Microsoft Windows Server 2012 R2 Std | ||||
Microsoft Windows Server 2012 R2 Datacenter | ||||
Microsoft Windows Server 2012 Datacenter | ||||
Microsoft Windows Server 2008 R2 | ||||
Microsoft Windows Server 2008 for x64 | ||||
Microsoft Windows Server 2008 | ||||
Microsoft Windows Server 2003 Standard Edition | ||||
Microsoft Windows Server 2003 for x64 | ||||
Microsoft Windows Server 2003 Enterprise Edition | ||||
Microsoft Windows Server 2003 Datacenter Edition | ||||
Microsoft Windows NT Workstation | ||||
Microsoft Windows 2000 Server | ||||
Microsoft Windows 2000 Professional | ||||
Microsoft Windows 2000 Datacenter Server | ||||
Microsoft Windows 95/98 | ||||
Microsoft Windows 2000 Advanced Server | ||||
Microsoft Windows 8.1 Pro 32-bit | ||||
Microsoft Windows 8.1 Pro | ||||
Microsoft Windows 8.1 Enterprise 32-bit | ||||
Microsoft Windows 8.1 Enterprise x64 | ||||
Microsoft Windows 8 Pro x64 | ||||
Microsoft Windows 8 Pro 32-bit | ||||
Microsoft Windows 8 Enterprise 32-bit | ||||
Microsoft Windows 8 Enterprise x64 | ||||
OS/2 | ||||
Microsoft Windows XP 64-bit Edition | ||||
Microsoft® Windows® for x64 | ||||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | ||||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | ||||
Microsoft® Windows® for 64-Bit Itanium-based Systems | ||||
OpenVMS VAX | ||||
z/OS | ||||
Z64 | ||||
Windows Millennium Edition (Me) | ||||
Windows Vista | ||||
Windows Vista for x64 | ||||
64-bit Enabled AIX | ||||
64-bit Enabled HP-UX | ||||
64-bit Enabled Solaris | ||||
ABI+ for Intel Architecture | ||||
AIX | ||||
HP-UX | ||||
HP-UX IPF | ||||
IRIX | ||||
Linux | ||||
Linux for x64 | ||||
Linux on Itanium | ||||
OpenVMS Alpha | ||||
OpenVMS on HP Integrity | ||||
Solaris | ||||
Solaris for x64 | ||||
Tru64 UNIX |
Type: | Usage Note |
Priority: | |
Topic: | Analytics ==> Categorical Data Analysis Analytics ==> Regression SAS Reference ==> Procedures ==> LOGISTIC |
Date Modified: | 2020-01-13 11:13:22 |
Date Created: | 2014-07-01 14:11:42 |