------------------------------------------------------------------------------- help forgraphbinary-------------------------------------------------------------------------------

An exploratory graphic investigating a binary endpoint

graphbinaryvarlist, [sort(graph_options)legend(string)orrrsize(relativesize)level(#)graph_combine_options]

DescriptionThis command creates an exploratory graphic looking at relationships between a binary dependent variable against several explanatory variables. Explanatory variables that have more than 2 values will be dichotomised by its median. When the median is equal to the minimum value this variable will be excluded from the graphic.

The graphic consists of two panels, the percentage of people that are coded 1 for the dependent variable for each level of the explanatory variable. The second panel plots the relative risk and confidence intervals against the variable name.

There are very few built-in options for this graphic and relies on the use of graph_combine options.

Make sure you have the latest version of this command ssc install graphbinary, replace

Options

sort(graph_options)specifies the order in which the explanatory variables are specified on the y-axis. There are only a handful of choices sorting by variable namename, by relative risk magnitudeeffect, by the relative risk's upper/lower confidence limitupper / loweror by the percentage of people with outcome 1 and high/yes or low/no for the explanatory variableyesorlow.

legend(string)specifies the legend for the graphic in panel 1.

orspecify that the odds ratio rather than risk ratio be plotted in panel 2.

rrspecifies that the risk ratio be plotted in panel 2.

size(relative size percentage)specifies the percent of width available for panel 2. 50% means that panel 2 covers half the space in the final graphic, the default is 40%.

level(#)specifies the confidence level, in percent, for confidence intervals; see help level.

ExamplesThe examples are all the analysis of the low birth weight data that can be obtained by the

webusecommand.** webuse lbw (MUST load data first) **

graphbinary low age lwt race smoke ht ui graphbinary low age lwt smoke ht ui, or graphbinary low age lwt smoke ht ui, sort(effect) graphbinary low age lwt smoke ht ui, sort(lower) title(Risk Factors) graphbinary low age lwt smoke ht ui, sort(upper) legend(lab(1 "Unexposed") lab( > 2 "Exposed")) graphbinary low age lwt smoke ht ui, sort(name) title(Risk Factors) subtitle(sorted by variable name) graphbinary low age lwt smoke ht ui, sort(yes)

The last graph is a little more complicated by changing the size of panel 2.

graphbinary low age lwt smoke ht ui, sort(no) size(16) subtitle(sorted by unexposed risk) legend(lab(1 "Unexposed") lab(2 "Exposed")) l(99)

AuthorAdrian Mander, MRC HNR Unit, Cambridge, UK. Email adrian.mander@mrc-hnr.cam.ac.uk

Also seeRelated commands

graph_combine.