Unlike PROC LOGISTIC, the GENMOD and GEE procedures do not provide odds ratio estimates for logistic models by default. When fitting a model in these procedures, odds ratios are only possible when the response is binary or multinomial (DIST=BIN or DIST=MULT) and the link involves a logit function (LINK=LOGIT or LINK=CUMLOGIT). You can use the EXP option in an appropriate ESTIMATE statement to obtain an odds ratio estimate and confidence interval. Beginning with SAS/STAT 9.22 in SAS 9.2 TS2M3, you can also use the EXP option in the LSMESTIMATE statement, or the DIFF and ODDSRATIO (or EXP) options in the LSMEANS or SLICE statement. To use the LSMEANS, LSMESTIMATE, or SLICE statement, you must use the default parameterization (PARAM=GLM) in the CLASS statement. See the descriptions of these statements and options in the GENMOD and GEE documentation. A binary logistic example using a main effects model is shown below. An example using all of these statements in a binary logistic model with interaction appears in this note on the CONTRAST and ESTIMATE statements. In particular, see "Example 3: A Two-Factor Logistic Model with Interaction Using Dummy and Effects Coding." An example in a generalized logit model for a nominal, multinomial response appears in this note.
The ESTIMATE statement is the most flexible way to estimate an odds ratio, but it is also the most complex since you must specify the contrast coefficients defining the desired difference of log odds. The ESTIMATE statement should only be used when one of the statements, described below, cannot be used. Only the ESTIMATE statement can be used to estimate odds ratios when a continuous predictor is involved. To obtain an odds ratio estimate, the ESTIMATE statement should specify coefficients of a linear combination of model parameters that define a difference between two groups. This will cause the ESTIMATE statement to estimate the difference in log odds for the two groups when the model is a logistic model. The process for determining appropriate ESTIMATE statement coefficients is described and illustrated in the note on the CONTRAST and ESTIMATE statements. The same can be done with longitudinal logistic models fit by Generalized Estimating Equations (GEE) using the REPEATED statement.
The LSMEANS statement may be the easiest way to obtain odds ratio estimates if the groups to be compared only involve levels of CLASS variables. The DIFF option will provide all pairwise comparisons of the levels of the specified variable or interaction. This removes the need for you to specify a linear combination for the specific comparison desired. In a logistic model, an LS-mean is a log odds. The DIFF option computes differences of the log odds which are log odds ratios. Adding the ODDSRATIO (or EXP) option exponentiates the log odds ratios resulting in odds ratio estimates. The CL option provides confidence limits. The ILINK option applies the inverse of the logit link to the individual LS-means (log odds) estimates resulting in estimates of the event probabilities.
The LSMESTIMATE statement can be much easier to use than the ESTIMATE statement since you specify a linear combination of the LS-means themselves and not of the model parameters. This makes specifying the desired comparison much easier particularly when the model involves interactions. Since the LSMEANS statement provides the list of LS-means, you just need to specify a corresponding list of coefficients that compares the two groups of interest. Adding the EXP option exponentiates the log odds differences resulting in odds ratio estimates. The CL option provides confidence limits.
The SLICE statement can be used to estimate odds ratios for CLASS predictors involved in interactions. By specifying an interaction effect such as A*B in the SLICE statement you obtain comparisons among the levels of CLASS predictor A at each level of CLASS predictor B. You can use the SLICEBY= option to control which comparisons are presented. The DIFF and ODDSRATIO (or EXP) options again provide estimates of differences of log odds and odds ratios, and the CL option provides confidence limits. See this note for an example of using the SLICE statement to estimate odds ratios in a logistic model with interaction.
For instance, consider the Generalized Estimating Equations (GEE) example in the "Getting Started" section of the GENMOD documentation. The interpretations below also apply to models that don't use the REPEATED statement. The first ESTIMATE statement below produces the odds ratio estimate and confidence interval for a unit increase in AGE. Only the ESTIMATE statement can be used since AGE is a continuous predictor. The remaining statements all estimate the CITY odds ratio - only one is needed for that purpose. The odds ratio comparing the Kingston to Portage cities is provided by the second ESTIMATE statement. The LSMEANS statement provides log odds, odds, and probability estimates for each city and all pairwise comparisons of the cities giving log odds ratio and odds ratio estimates and confidence limits. The LSMESTIMATE statement does the same but only for the specified comparison of cities.
proc genmod data=six descending; class case city; model wheeze = city age smoke / dist=bin; repeated subject=case / type=exch; estimate "log O.R. Age" age 1 / exp; estimate "log O.R. Kingston vs Portage" city 1 -1 / exp; lsmeans city / ilink exp diff cl; lsmestimate city 'Kingston vs Portage' 1 -1 / exp cl; run;
The "Contrast Estimate Results" table contains the results from the two ESTIMATE statements. The estimated change in the odds of wheezing for a one year increase in AGE is 0.8158 with confidence interval (0.4723, 1.4093). The odds of wheezing for children in Kingston is estimated to be 1.1301 times the odds of wheezing for children in Portage with confidence interval (0.2933, 4.3548). The Mean Estimate is computed by applying the inverse link function to the linear combination of parameter estimates specified in the ESTIMATE statement. This is useful when the ESTIMATE statement specifies a single logit (log odds), but is meaningless when it specifies a difference in log odds as in the ESTIMATE statements above.
The LSMEANS statement produces the "CITY Least Squares Means" table which gives, for each city, estimates of the log odds of wheezing (Estimate column), the probability of wheezing (Mean column from the ILINK option), and the odds of wheezing (Exponentiated column from the EXP option). The DIFF option produces the "Differences of CITY Least Squares Means" table which gives estimates of the log odds ratios (Estimate column) among the cities. Just one difference appears since there are only two cities in this example. The EXP and CL options add the odds ratios and confidence limits (Exponentiated columns) which match the results from the second ESTIMATE statement. If you replace the EXP option with the ODDSRATIO option, the same results are provided, but the Exponentiated columns in the Differences table are instead labeled as Odds Ratios.
The LSMESTIMATE statement with the EXP and CL options requests one comparison of cities and produces the "Least Squares Means Estimate" table giving the same result for this comparison as the DIFF option in the LSMEANS statement.
|
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | SAS/STAT | z/OS | ||
OpenVMS VAX | ||||
Microsoft® Windows® for 64-Bit Itanium-based Systems | ||||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | ||||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | ||||
Microsoft Windows XP 64-bit Edition | ||||
Microsoft® Windows® for x64 | ||||
OS/2 | ||||
Microsoft Windows 95/98 | ||||
Microsoft Windows 2000 Advanced Server | ||||
Microsoft Windows 2000 Datacenter Server | ||||
Microsoft Windows 2000 Server | ||||
Microsoft Windows 2000 Professional | ||||
Microsoft Windows NT Workstation | ||||
Microsoft Windows Server 2003 Datacenter Edition | ||||
Microsoft Windows Server 2003 Enterprise Edition | ||||
Microsoft Windows Server 2003 Standard Edition | ||||
Microsoft Windows Server 2003 for x64 | ||||
Microsoft Windows Server 2008 | ||||
Microsoft Windows Server 2008 for x64 | ||||
Microsoft Windows XP Professional | ||||
Windows 7 Enterprise 32 bit | ||||
Windows 7 Enterprise x64 | ||||
Windows 7 Home Premium 32 bit | ||||
Windows 7 Home Premium x64 | ||||
Windows 7 Professional 32 bit | ||||
Windows 7 Professional x64 | ||||
Windows 7 Ultimate 32 bit | ||||
Windows 7 Ultimate x64 | ||||
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 ==> Longitudinal Analysis SAS Reference ==> Procedures ==> GENMOD SAS Reference ==> Procedures ==> GEE |
Date Modified: | 2021-05-27 16:21:52 |
Date Created: | 2011-03-18 10:14:47 |