Graphics Reference
In-Depth Information
graph hbox tenure, nooutsides over(occ7,
descending
)
Consider this graph showing
tenure
broken down by the seven levels of
occupation. The boxes would normally
be ordered by levels of
occ7
, going from
1to7. The
descending
option
switches the order of the boxes. They
still are ordered according to the seven
levels of occupation, but the boxes are
ordered going from 7 to 1.
Uses nlsw.dta & scheme vg past
Other
Labor
Operat.
Cler.
Sales
Mgmt
Prof
0
5
10
15
20
25
Curr. work exper.
excludes outside values
graph hbox tenure, nooutsides over(occ7,
sort(occ7alpha)
)
We might want to put these boxes in
alphabetical order, but with Other still
appearing last. We can do this by
recoding
occ7
into a new variable (say
occ7alpha
) such that, as
occ7alpha
goes from 1 to 7, the occupations
alphabetically ordered. We recoded
occ7
with these assignments: 4 = 1,
6=2,2=3,5=4,1=5,3=6,and
7 = 7. Then, the
sort(occ7alpha)
option alphabetizes the boxes (but with
Other still appearing last).
Uses nlsw.dta & scheme vg past
Cler.
Labor
Mgmt
Operat.
Prof
Sales
Other
0
5
10
15
20
25
Curr. work exper.
excludes outside values
graph hbox tenure, nooutsides over(occ7,
sort(1)
)
Here, we sort the variables based on the
median of
tenure
, yielding boxes with
medians in ascending order. The
sort(1)
option sorts the boxes
according to the median of the first
y
Cler.
Labor
Sales
Operat.
-variable, meaning to sort on the
median of
tenure
.
Uses nlsw.dta & scheme vg past
Mgmt
Prof
Other
0
5
10
15
20
25
Curr. work exper.
excludes outside values
The electronic form of this topic is solely for direct use at UCLA and only by faculty, students, and staff of UCLA.