📄 twoway_mband.hlp
字号:
{smcl}
{* 08apr2005}{...}
{cmd:help mband}{right:dialogs: {dialog twoway_overlay:overlaid twoway}{space 0}}
{right:{dialog twoway_simple:single twoway}{space 2}}
{hline}
{p2colset 5 31 33 2}{...}
{p2col :{hi:[G] graph twoway mband} {hline 2}}Twoway median-band plots{p_end}
{p2colreset}{...}
{title:Syntax}
{p 8 54 2}
{cmdab:tw:oway}
{cmd:mband}
{it:yvar}
{it:xvar}
{ifin}
[{cmd:,}
{it:options}]
{p2colset 9 31 33 2}{...}
{it:options}{col 31}description
{p2line}
{cmdab:b:ands:(}{it:#}{cmd:)}{...}
{col 31}number of bands
INCLUDE help gr_clopt
INCLUDE help gr_axlnk
INCLUDE help gr_twopt
{p2line}
{pin}
All options are {it:rightmost}; see {help repeated options}.
{title:Description}
{pstd}
{cmd:twoway} {cmd:mband} calculates
cross medians and then graphs the cross medians as a line plot.
{title:Options}
{phang}
{cmd:bands(}{it:#}{cmd:)}
specifies the number of bands on which the calculation is to be based.
The default is max(10, round(10*log10(N))), where N is the number of
observations.
{pmore}
In a median-band plot, the {it:x} axis is divided into {it:#}
equal-width intervals and then the median of {it:y} and the
median of {it:x} are calculated in each interval.
It is these cross medians that {cmd:mband} graphs as a line plot.
{phang}
{it:cline_options}
specify how the median-band line is rendered and its appearance;
see {it:{help cline_options}}.
INCLUDE help gr_axlnkf
INCLUDE help gr_twoptf
{title:Remarks}
{pstd}
Remarks are presented under the headings
{help twoway mband##remarks1:Typical use}
{help twoway mband##remarks2:Use with by()}
{marker remarks1}{...}
{title:Typical use}
{pstd}
Median bands provide a convenient but crude way to show the tendency in the
relationship between {it:y} and {it:x}:
{cmd:. sysuse auto, clear}
{cmd:. scatter mpg weight, msize(*.5) || mband mpg weight}
{it:({stata "gr_example auto: scatter mpg weight, msize(*.5) || mband mpg weight":click to run})}
{* graph gtmband1}{...}
{pstd}
The important part of the above is "{cmd:mband} {cmd:mpg} {cmd:weight}".
On the {cmd:scatter}, we specified {cmd:msize(*.5)} to make the marker
symbols half their normal size; see {it:{help relativesize}}.
{marker remarks2}{...}
{title:Use with by()}
{pstd}
{cmd:mband} may be used with {cmd:by()} (as can all the {cmd:twoway} plot
commands):
{cmd:. scatter mpg weight, ms(oh) ||}
{cmd: mband mpg weight ||, by(foreign, total row(1))}
{it:({stata "gr_example auto: scatter mpg weight, ms(oh) || mband mpg weight ||, by(foreign, total row(1))":click to run})}
{* graph gtmband2}{...}
{pstd}
In the above graph, we specified {cmd:ms(oh)} so as to use hollow symbols;
see {it:{help symbolstyle}}.
{title:Also see}
{psee}
Manual: {bf:[G] graph twoway mband}
{psee}
Online:
{helpb line},
{helpb twoway mspline},
{helpb twoway lfit},
{helpb twoway qfit},
{helpb twoway fpfit}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -