Graphics Reference
In-Depth Information
graph dot prev exp tenure ttl exp, ascategory
over(south, relabel(1 "N & W" 2 "South"))
yvaroptions(relabel(1 "Previous" 2 "Current" 3 "Total"))
In this example, we have multiple
y
-variables that are converted into
categorical variables via the
ascategory option, and an over()
variable, as well. The relabel() option
within the over() option changes the
labels for south , and the relabel()
option within yvaroptions() changes
the labels for the multiple
Previous
N & W
Current
Total
Previous
South
Current
-variables.
Uses nlsw.dta & scheme vg past
y
Total
0
5
10
15
graph dot prev exp tenure ttl exp, ascategory xalternate
over(south, relabel(1 "N & W" 2 "South"))
yvaroptions(relabel(1 "Previous" 2 "Current" 3 "Total"))
We add the xalternate option, which
moves the labels for the
x
-axis to the
opposite side, in this case, from the left
to the right. We could also use the
yalternate option to move the
Previous
N & W
Current
y
-axis
Total
to its opposite side.
Uses nlsw.dta & scheme vg past
Previous
South
Current
Total
0
5
10
15
graph dot wage, over(occ7)
l1title("Occupations recoded" "into seven categories")
In this example, the categorical axis
represents the occupation after recoding
it into seven categories. We can use the
l1title() option to add a title to the
left of the graph labeling this axis. Note
that we broke the title into two quoted
strings that appear on the graph as two
lines. We could also add a second title
to the left with l2title() ;see Standard
options : Titles (313) for more details.
Uses nlsw.dta & scheme vg past
Prof
Mgmt
Sales
Cler.
Operat.
Labor
Other
0
2
4
6
8
10
mean of wage
The electronic form of this topic is solely for direct use at UCLA and only by faculty, students, and staff of UCLA.
Search WWH ::




Custom Search