📄 graph_dot.hlp
字号:
{smcl}
{* 28apr2005}{...}
{cmd:help graph dot}{right:dialogs: (summary statistics) {bf:{dialog dot:graph dot}} {dialog edot:easy graph dot}}
{right: (observed data) {bf:{dialog dot_data:graph dot}} {dialog edot_data:easy graph dot}}
{hline}
{* index dot plots}{...}
{* index over() tt option}{...}
{* index ascategory() tt option}{...}
{* index asyvars() tt option}{...}
{title:Title}
{p2colset 5 22 24 2}{...}
{p2col :{hi:[G] graph dot} {hline 2}}Dot charts{p_end}
{p2colreset}{...}
{title:Syntax}
{p 8 23 2}
{cmdab:gr:aph} {cmd:dot}{space 2}{it:yvars}
{ifin}
{weight}
[{cmd:,}
{it:options}]
where {it:yvars} is
{col 20}{cmd:(asis)} {it:varlist}
or is
{col 20}[{cmd:(}{it:stat}{cmd:)}] {it:varname}{...}
[[{cmd:(}{it:stat}{cmd:)}] ...]
{...}
{col 20}[{cmd:(}{it:stat}{cmd:)}] {it:varlist}{...}
[[{cmd:(}{it:stat}{cmd:)}] ...]
{...}
{col 20}[{cmd:(}{it:stat}{cmd:)}] {it:name}{cmd:=}{it:varname} [...]{...}
[[{cmd:(}{it:stat}{cmd:)}] ...]
{pin}
where {it:stat} may be any of
{p_end}
{p 20 20 2}
{cmd:mean}
{cmd:median}
{cmd:p1}
{cmd:p2}
... {cmd:p99}
{cmd:sum}
{cmd:count}
{cmd:min}
{cmd:max}
{p_end}
or
{p 20 20 2}
any of the other {it:stats} defined in {helpb collapse}
{pin}
{cmd:mean} is the default. {cmd:p1} means the 1st percentile, {cmd:p2}
means the 2nd percentile, and so on; {cmd:p50} means the same as
{cmd:median}. {cmd:count} means the number of nonmissing values of the
specified variable.
{it:options}{col 38}description
{hline 70}
{help graph dot##group_options:{it:group_options}}{...}
{col 38}groups over which lines of dots are drawn
{help graph dot##yvar_options:{it:yvar_options}}{...}
{col 38}variables that are the dots
{help graph dot##linelook_options:{it:linelook_options}}{...}
{col 38}how the lines of dots look
{help graph dot##legending_options:{it:legending_options}}{...}
{col 38}how {it:yvars} are labeled
{help graph dot##axis_options:{it:axis_options}}{...}
{col 38}how the numerical {it:y} axis is labeled
{help graph dot##title_and_other_options:{it:title_and_other_options}}{...}
{col 38}titles, added text, aspect ratio, etc.
{hline 72}
{it:group_options}{marker group_options}{col 40}description
{hline 70}
{cmdab:o:ver:(}{it:varname}[{cmd:,} {help graph dot##over_subopts:{it:over_subopts}}]{cmd:)}{...}
{col 40}categories; option may be repeated
{cmd:nofill}{...}
{col 40}omit empty categories
{cmdab:miss:ing}{...}
{col 40}keep missing value as category
{cmdab:allc:ategories}{...}
{col 40}include all categories in the dataset
{hline 70}
{it:yvar_options}{marker yvar_options}{col 40}description
{hline 70}
{cmdab:asc:ategory}{...}
{col 40}treat {it:yvars} as first {cmd:over()} group
{cmdab:asy:vars}{...}
{col 40}treat first {cmd:over()} group as {it:yvars}
{cmdab:per:centages}{...}
{col 40}show percentages within {it:yvars}
{cmdab:cw}{...}
{col 40}calculate {it:yvar} statistics omitting
{col 40} missing values of any {it:yvar}
{hline 70}
{p2colset 9 39 42 2}{...}
{it:linelook_options}{marker linelook_options}{col 40}description
{hline 70}
{cmd:outergap(}[{cmd:*}]{it:#}{cmd:)}{...}
{col 40}gap between top and first line
{col 40} and between last line and bottom
{cmd:linegap(}{it:#}{cmd:)}{...}
{col 40}gap between {it:yvar} lines; default is 0
{cmdab:m:arker:(}{it:#}{cmd:,} {it:{help marker_options}}{cmd:)}{...}
{col 40}marker used for #th {it:yvar} line
{cmdab:pcyc:le:(}{it:#}{cmd:)}{...}
{col 40}marker styles before {help pstyle:pstyles} recycle
{cmdab:linet:ype:(dot}|{cmd:line}|{cmd:rectangle)}{...}
{col 40}type of line
{p2col : {cmdab:ndot:s:(}{it:#}{cmd:)}}{...}
# of dots if {cmd:linetype(dot)}; default is 100{p_end}
{cmdab:dot:s:(}{it:{help marker_options}}{cmd:)}{...}
{col 40}look if {cmd:linetype(dot)}
{cmdab:line:s:(}{it:{help line_options}}{cmd:)}{...}
{col 40}look if {cmd:linetype(line)}
{cmdab:rect:angles:(}{it:{help area_options}}{cmd:)}{...}
{col 40}look if {cmd:linetype(rectangle)}
{cmd:rwidth(}{it:{help relativesize}}{cmd:)}{...}
{col 40}rectangle width if {cmd:linetype(rectangle)}
[{cmdab:no:}]{cmdab:ext:end:line}{...}
{col 40}whether line extends through plot region
{col 40} margins; {cmd:extendline} is usual default
{cmdab:lowex:tension(}{it:{help relativesize}}{cmd:)}{...}
{col 40}extend line through axis (advanced)
{cmdab:highex:tension(}{it:{help relativesize}}{cmd:)}{...}
{col 40}extend line through axis (advanced)
{hline 70}
{it:legending_options}{marker legending_options}{col 40}description
{hline 70}
{it:{help legend_option}}{...}
{col 40}control of {it:yvar} legend
{cmdab:nolab:el}{...}
{col 40}use {it:yvar} names, not labels, in legend
{cmdab:yvar:options:(}{help graph dot##over_subopts:{it:over_subopts}}{cmd:)}{...}
{col 40}{it:over_subopts} for {it:yvars}; rarely specified
{cmd:showyvars}{...}
{col 40}label {it:yvars} on {it:x} axis; rarely specified
{hline 70}
{it:axis_options}{marker axis_options}{col 40}description
{hline 70}
{cmdab:yalt:ernate}{...}
{col 40}put numerical {it:y} axis on right (top)
{cmdab:xalt:ernate}{...}
{col 40}put categorical {it:x} axis on top (right)
{cmd:exclude0}{...}
{col 40}do not force {it:y} axis to include 0
{cmdab:yrev:erse}{...}
{col 40}reverse {it:y} axis
{it:{help axis_scale_options}}{...}
{col 40}{it:y}-axis scaling and look
{it:{help axis_label_options}}{...}
{col 40}{it:y}-axis labeling
{help axis_title_options:{bf:ytitle(...)}}{...}
{col 40}{it:y}-axis titling
{hline 70}
{pstd}{marker title_and_other_options}
The {it:title_and_other_options} are
{it:title_and_other_options}{col 40}description
{hline 70}
{help added_text_option:{bf:text(...)}}{...}
{col 40}add text on graph; {it:x} range [0,100]
{help added_line_options:{bf:yline(...)}}{...}
{col 40}add {it:y} lines to graph
{it:{help aspect_option}}{...}
{col 40}constrain aspect ratio of plot region
{it:{help std_options}}{...}
{col 40}titles, graph size, saving to disk
{help by_option:{bf:by(}{it:varlist}{bf:, ...)}}{...}
{col 40}repeat for subgroups
{hline 70}
{pstd}{marker over_subopts}
The {it:over_subopts}{hline 2}used in
{cmd:over(}{it:varname}{cmd:,} {it:over_subopts}{cmd:)}
and, on rare occasion, in
{cmd:yvaroptions(}{it:over_subopts}{cmd:)}{hline 2}are
{it:over_subopts}{col 40}description
{hline 70}
{cmdab:re:label:(}{it:#} {cmd:"}{it:text}{cmd:"} ...{cmd:)}{...}
{col 40}change axis labels
{cmdab:lab:el:(}{it:{help cat_axis_label_options}}{cmd:)}{...}
{col 40}rendition of labels
{cmdab:ax:is:(}{it:{help cat_axis_line_options}}{cmd:)}{...}
{col 40}rendition of axis line
{cmd:gap(}[{cmd:*}]{it:#}{cmd:)}{...}
{col 40}gap between lines within {cmd:over()} category
{cmd:sort(}{it:varname}{cmd:)}{...}
{col 40}put lines in prespecified order
{cmd:sort(}{it:#}{cmd:)}{...}
{col 40}put lines in height order
{cmd:sort((}{it:stat}{cmd:)} {it:varname}{cmd:)}{...}
{col 40}put lines in derived order
{cmdab:des:cending}{...}
{col 40}reverse default or specified line order
{hline 70}
{pstd}
{cmd:aweight}s, {cmd:fweight}s, and {cmd:pweight}s are
allowed; see {help weight} and see note concerning weights in
{helpb collapse}.
{title:Description}
{pstd}
{cmd:graph} {cmd:dot} draws horizontal dot charts. In a dot
chart, the categorical axis is presented vertically, and the numerical axis
is presented horizontally. Even so, the numerical axis is called the {it:y}
axis, and the categorical axis is still called the {it:x} axis:
{phang2}
{cmd:. graph dot (mean)} {it:numeric_var}{cmd:, over(}{it:cat_var}{cmd:)}
{it:x}
{c |}
first group {c |}......o..............
{c |}
second group {c |}..........o..........
{bf:.} {c |}
{bf:.} {c |}
{c BLC}{c TT}{hline 4}{c TT}{hline 4}{c TT}{hline 4}{c TT}{hline 4}{c TT}
0 2 4 6 8
{pstd}
The syntax for dot charts is identical to that for bar charts;
see {helpb graph bar}.
{pstd}
We use the following words to describe a dot chart:
{it:x axis}
{c |}
Group 1 {c |}..........o...............
Group 2 {c |}..............o...........
Group 3 {c |}..................o....... <- {it:lines}
Group 4 {c |}......................o...
{c BLC}{c TT}{hline 4}{c TT}{hline 4}{c TT}{hline 4}{c TT}{hline 4}{c TT}{hline 4}{c TT}
0 1 2 3 4 5 <- {it:y axis}
{pstd}
The above dot chart contains four {it:lines}. The words used to describe a
line are
{p_end}
{it:marker}
/
.............o............
|{hline 2}{it:distance}{hline 2}| \
{it:dots}
{title:group_options}
{phang}
{cmd:over(}{it:varname}[{cmd:,} {it:over_subopts}]{cmd:)}
specifies a categorical variable over which the {it:yvars} are to be
repeated. {it:varname} may be string or numeric. Up to two {cmd:over()}
options may be specified when multiple {it:yvars} are specified, and up to
three {cmd:over()}s may be specified when a single {it:yvar} is specified;
options may be specified; see {hi:Appendix: Examples of syntax} below.
{phang}
{cmd:nofill}
specifies that missing subcategories be omitted. For instance,
consider
{phang3}
{cmd:. graph dot (mean) y, over(division) over(region)}
{pmore}
Say that one of the divisions has no data for one of the regions, either
because there are no such observations or because y==. for such
observations. In the resulting chart, the marker will be missing:
division 1 {c |}...........o....
region 1 division 2 {c |}....o...........
division 3 {c |}.......o........
{c |}
division 1 {c |}..o.............
region 2 division 2 {c |}................
division 3 {c |}..........o.....
{c BLC}{c TT}{hline 4}{c TT}{hline 4}{c TT}{hline 4}{c TT}
{pmore}
If you specify {cmd:nofill}, the missing category will be removed
from the chart:
division 1 {c |}...........o....
region 1 division 2 {c |}....o...........
division 3 {c |}.......o........
{c |}
region 2 division 1 {c |}..o.............
division 3 {c |}..........o.....
{c BLC}{c TT}{hline 4}{c TT}{hline 4}{c TT}{hline 4}{c TT}
{phang}
{cmd:missing}
specifies that missing values of the {cmd:over()} variables be kept as
their own categories, one for {cmd:.}, another for {cmd:.a}, etc. The
default is ignore such observations. An {cmd:over()} variable is
considered to be missing if it is numeric and contains a missing value or
if it is string and contains "".
{phang}
{cmd:allcategories}
specifies that all categories in the entire dataset be retained for the
{cmd:over()} variables. When {cmd:if} or {cmd:in} are specified without
{cmd:allcategories}, the graph is drawn, completely excluding any
categories for the {cmd:over()} variables that do not occur in the
specified subsample. With the {cmd:allcategories} option, categories that
do not occur in the subsample still appear in the legend, and zero-height
bars are drawn where these categories would appear. Such behavior can be
convenient when comparing graphs of subsamples that do not include
completely common categories for all {cmd:over()} variables. This option
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -