Graphical methodsLinear modelsCategorical dataStructural equation modelsUtility macrosMy Books
Univariate displays
Bivariate displays
Multivariate displays
Cluster analysis
Maps
boxplot
density
dotplot
nqplot
splot
symbox
symplot
contour
ellipses
lowess
miplot
resline
sparkline
sunplot
surface
biplot
canplot
coplot
corrgram
cqplot
faces
genscat
hecan
hemat
hemreg
heplot
heplots
mpower
outlier
robcov
scatmat
scatter
stars
gtree
ccmap
map2gen
ANOVA
Regression
Multivariate
Transformations
Power
alleff
effplot
hovplot
meanplot
orpoly
poly
twoway
cpplot
effplot
partial
inflplot
robust
rsqdelta
hecan
hemat
hemreg
heplot
heplots
boxcox
boxglm
boxtid
sprdplot
fpower
mpower
power
rpower
Discrete distributions
Two-way tables
Mosaic displays
Generalized linear models
distplot
goodfit
ordplot
poisplot
rootgram
agree
agreeplot
corresp
ffold
fourfold
power2x2
powerrxc
sieve
sieveplot
missrc
genscat
mosaic
mosaics
mosmat
addvar
catplot
effplot
halfnorm
inflglim
inflogis
logodds
powerlog
robust
caliscmp
calisgfi
csmpower
eqs2ram
ram2dot
str2ram
Data utility
Graphics utility
Macro utility
Color
combine
combos
dummy
expgrid
interact
jitter
lags
map2gen
multisummary
mvnormal
sas2vsta
scale
slice
sort
stat2dat
table
axis
bars
boxanno
boxaxis
equate
gask
gbank
gdispla
genpat
gensym
gkill
gskip
inset
label
labels
lines
panels
points
polygons
pscale
regline
rug
expglm
defined
lastword
vexpand
words
bpycolors
brewerpal
colochrt
colorramp
SAS System for Statistical Graphics
Visualizing Categorical Data
Visual Statistics
logodds Plot empirical log-odds for logistic regression logodds

Visualizing Categorical Data: logodds

$Version: 1.1 (11 Mar 2001)
Michael Friendly
York University

The logodds macro ( [download] get logodds.sas)

Plot empirical log-odds for logistic regression

For a binary response variable, Y, taking values 0 or 1, and a continuous independent variable, X, the LOGODDS macro groups the X variable into some number of ordered, non-overlapping intervals. It plots the empirical log-odds of Y=1 (and/or Pr{Y=1}) against X for each interval of X, together with the fitted linear logistic relation, an optional smoothed curve (using the LOWESS macro), and the observed binary responses.

Usage

The input data to be plotted must be in case form. The LOGODDS macro is called with keyword parameters. The X= and Y= variables are required. The arguments may be listed within parentheses in any order, separated by commas. For example:
  
  %logodds(data=icu, x=age, y=died);

Parameters

X=
Name of the continuous independent variable
Y=
Name of the binary response variable
EVENT=
Value of Y for the event of interest [Default: EVENT=1]
DATA=
The name of the input data set [Default: DATA=_LAST_]
OPTIONS=
Options for PROC LOGISTIC, for example, OPTIONS=DESCENDING.
NCAT=
Number of categories of the X variable. For example, if deciles of X are desired, use NCAT=10. [Default: NCAT=10]
PLOT=
Scale(s) for the response. PLOT=LOGIT gives a plot on the logit scale, PLOT=PROB on the probability scale. [Default: PLOT=LOGIT PROB]
SMOOTH=
Smoothing parameter for a lowess smooth, in the interval (0-1). No smooth curve is produced unless a SMOOTH= value is specified.
SHOW=
Specifies whether to plot the binary observations. [Default: SHOW=OBS]
OBS=
Specifies how to display the binary observations. If OBS=STACK, the observations are plotted in vertical columns at the top (Y=1) or bottom (Y=0) of the plot. If OBS=JITTER a small random quantity is added (Y=0) or subtracted (Y=1) to the Y value. [Default: OBS=STACK]
NAME=
The name of the graph in the graphic catalog [Default: NAME=LOGODDS]
GOUT=
The name of the graphic catalog [Default: GOUT=GSEG]

Example

  
  %include catdata(icu);
  %logodds(data=icu, x=age, y=died, smooth=0.25, ncat=16,
     options=order=data);

See also

inflogis Influence plot for logistic regression models
powerlog Power for logistic regression, quantitative predictor

[Previous] [Next] [Up] [Contents] [Search]
Previous: lags Next: mosaic Up: Appendix A Top: index.html