Graphics Reference
In-Depth Information
graph bar (mean)
meanwage=wage
(median)
medwage=wage
You can plot different summary
statistics for the same
-variable, but
you must specify a target name for the
statistic being created. Here, we create
meanwage
for the mean of
wage
and
medwage
for the median of
wage
.Ifwe
omitted the
meanwage=
and
medwage=
from this command, Stata would return
an error indicating that the name for
the mean of
wage
conflicts with the
median of
wage
.
Uses nlsw.dta & scheme vg past
y
mean of wage
p 50 of wage
We now consider a handful of options that are useful when you have multiple
y
-variables.
These options allow you to display the
-variables as though they were categories of the
same variable, to create stacked bar charts, and to display the
y
y
-variables as percentages of
the total
y
-variables. These options are illustrated in the following graphs using the
vg s1m
scheme.
graph bar prev exp tenure ttl exp hours
First, consider this bar chart showing
four
-variable is
shown with a different colored bar and
with a legend indicating which
y
y
-variables. Each
y
-variable corresponds to which bar.
See the next example for another way
to differentiate these four bars.
Uses nlsw.dta & scheme vg s1m
mean of prev_exp
mean of tenure
mean of ttl_exp
mean of hours
The electronic form of this topic is solely for direct use at UCLA and only by faculty, students, and staff of UCLA.