⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 twoway_lfitci.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 08apr2005}{...}
{cmd:help twoway lfitci}{right:dialog:  {dialog erfit:easy regression fit}}
	{right:{dialog twoway_overlay:overlaid twoway}{space 4}}
	{right:{dialog twoway_simple:single twoway}{space 6}}
{hline}
{* index fits, adding}{...}

{title:Title}

{p2colset 5 32 34 2}{...}
{p2col :{hi:[G] graph twoway lfitci} {hline 2}}Twoway linear prediction plots with CIs{p_end}
{p2colreset}{...}


{title:Syntax}

{p 8 54 2}
{cmdab:tw:oway}
{cmd:lfitci}
{it:yvar} {it:xvar}
{ifin}
{weight}
[{cmd:,}
{it:options}]

{p2colset 9 38 42 2}{...}
	{it:options}{col 38}description
	{hline 70}
	{cmd:stdp}{...}
{col 38}CIs from SE of prediction; the default
	{cmd:stdf}{...}
{col 38}CIs from SE of forecast
	{cmd:stdr}{...}
{col 38}CIs from SE of resid.; seldom specified
	{cmd:level(}{it:#}{cmd:)}{...}
{col 38}confidence level for CI

	{cmdab:r:ange:(}{it:#} {it:#}{cmd:)}{...}
{col 38}range over which predictions calculated
	{cmd:n(}{it:#}{cmd:)}{...}
{col 38}number of prediction points
	{cmd:atobs}{...}
{col 38}calculate predictions at {it:xvar}
	{cmdab:est:opts:(}{it:regress_options}{cmd:)}{...}
{col 38}options for {cmd:regress}
	{cmdab:pred:opts:(}{it:predict_options}{cmd:)}{...}
{col 38}options for {cmd:predict}

	{cmd:nofit}{...}
{col 38}do not plot the prediction
	{cmdab:fitp:lot:(}{it:{help graph_twoway:plottype}}{cmd:)}{...}
{col 38}how to plot fit; {cmd:line} default
	{cmdab:cip:lot:(}{it:{help graph_twoway:plottype}}{cmd:)}{...}
{col 38}how to plot CIs; {cmd:rarea} default

	{it:{help cline_options}}{...}
{col 38}change look of predicted line
	{it:{help area_options}}{...}
{col 38}change look of CI

INCLUDE help gr_axlnk

INCLUDE help gr_twopt
	{hline 70}
{pin}
Options 
{cmd:range()}, {cmd:estopts()}, {cmd:predopts()}, {cmd:n()}, and {cmd:level()}
are {it:rightmost}; {cmd:atobs}, {cmd:nofit}, {cmd:fitplot()}, {cmd:ciplot()},
{cmd:stdp}, {cmd:stdf}, and {cmd:stdr} are {it:unique}; see
{help repeated options}.

{pstd}
{cmd:aweight}s,
{cmd:fweight}s, and
{cmd:pweight}s are allowed.  Weights, if specified, affect estimation but
not how the weighted results are plotted.  See {help weight}.


{title:Description}

{pstd}
{cmd:twoway} {cmd:lfitci} calculates the prediction for {it:yvar} based on a
linear regression of {it:yvar} on {it:xvar} and plots the resulting line,
along with a confidence interval.


{title:Options}

{phang}
{cmd:stdp},
{cmd:stdf}, and
{cmd:stdr}
    determine the basis for the confidence interval.  {cmd:stdp} is the
    default.

{pmore}
    {cmd:stdp} specifies that the confidence interval be the confidence
    interval of the mean.

{pmore}
    {cmd:stdf} specifies that the confidence interval be the confidence
    interval for an individual forecast, which includes both the uncertainty
    of the mean prediction and the residual.

{pmore}
    {cmd:stdr} specifies that the confidence interval be based only on the
    standard error of the residual.

{phang}
{cmd:level(}{it:#}{cmd:)}
    specifies the confidence level, as a percentage, for the confidence
    interval; see {helpb level}.

{phang}
{cmd:range(}{it:#} {it:#}{cmd:)}
    specifies the {it:x} range over which predictions are calculated.
    The default is {cmd:range(. .)}, meaning the minimum and maximum
    values of {it:xvar}.  {cmd:range(0 10)} would make the range 0
    to 10, {cmd:range(. 10)} would make the range the minimum to 10, and
    {cmd:range(0 .)} would make the range 0 to the maximum.

{phang}
{cmd:n(}{it:#}{cmd:)}
    specifies the number of points at which the predictions and the CI over
    {cmd:range()} are to be calculated.  The default is {cmd:n(100)}.

{phang}
{cmd:atobs}
is an alternative to {cmd:n()} and specifies that the predictions be
    calculated at the {it:xvar} values.  {cmd:atobs} is the default
    if {cmd:predopts()} is specified and any statistic other than the
    {cmd:xb} is requested.

{phang}
{cmd:estopts(}{it:regress_options}{cmd:)}
    specifies options to be passed along to {cmd:regress} to
    estimate the linear regression from which the line will be predicted;
    see {helpb regress}.  If this option is specified, 
    {cmd:estopts(nocons)} is also often specified.

{phang}
{cmd:predopts(}{it:predict_options}{cmd:)}
    specifies options to be passed along to {cmd:predict} to
    obtain the predictions after estimation by {cmd:regress}.

{phang}
{cmd:nofit}
    prevents the prediction from being plotted.

{phang}
{cmd:fitplot(}{it:plottype}{cmd:)}, which is seldom used, specifies how the
prediction is to be plotted.  The default is {cmd:fitplot(line)}, meaning that
the prediction will be plotted by {cmd:graph} {cmd:twoway} {cmd:line}.  See
{helpb graph twoway} for a list of {it:plottype} choices.  You may choose any
that expect a single {it:y} and a single {it:x} variable.

{phang}
{cmd:ciplot(}{it:plottype}{cmd:)}
    specifies how the confidence interval is to be plotted.  The
    default is {cmd:ciplot(rarea)}, meaning that the prediction will be
    plotted by {cmd:graph} {cmd:twoway} {cmd:rarea}.

{pmore}
    A reasonable alternative is {cmd:ciplot(rline)}, which will
    substitute lines around the prediction for shading.
    See {helpb graph twoway} for a list of {it:plottype} choices.
    You may choose any that expect two {it:y} variables and one {it:x}
    variable.

{phang}
{it:cline_options}
     specify how the prediction line is rendered;
     see {it:{help cline_options}}.
     If you specify {cmd:fitplot()}, then rather than using
     {it:cline_options}, you should select options that affect the specified
     {it:plottype} from the options in {help scatter}.

{phang}
{it:area_options}
     specify how the confidence interval is rendered; see 
     {it:{help area_options}}.
     If you specify {cmd:ciplot()}, then rather than using 
     {it:area_options}, you should specify whatever is appropriate.

INCLUDE help gr_axlnkf

INCLUDE help gr_twoptf


{title:Remarks}

{pstd}
Remarks are presented under the headings

        {help twoway_lfitci##remarks1:Typical use}
        {help twoway_lfitci##remarks2:Advanced use}
        {help twoway_lfitci##remarks3:Cautions}
        {help twoway_lfitci##remarks4:Use with by()}


{marker remarks1}{...}
{title:Typical use}

{pstd}
{cmd:twoway} {cmd:lfitci} by default draws the confidence interval
of the predicted mean:

	{cmd:. sysuse auto, clear}

	{cmd:. twoway lfitci mpg weight}
	  {it:({stata "gr_example auto: twoway lfitci mpg weight":click to run})}
{* graph gtlfitci1}{...}

{pstd}
If you specify the {cmd:ciplot(rline)} option, then rather than bein shaded,
the confidence interval will be designated by lines:

	{cmd:. twoway lfitci mpg weight, ciplot(rline)}
	  {it:({stata "gr_example auto: twoway lfitci mpg weight, ciplot(rline)":click to run})}
{* graph gtlfitci2}{...}


{marker remarks2}{...}
{title:Advanced use}

{pstd}
{cmd:lfitci} can be usefully overlaid with other plots:

	{cmd:. sysuse auto, clear}

{phang2}
	{cmd:. twoway lfitci mpg weight, stdf || scatter mpg weight}
{p_end}
	  {it:({stata "gr_example auto: twoway lfitci mpg weight, stdf || scatter mpg weight":click to run})}
{* graph gtlfitci3}{...}

{pstd}
Note that in the above example, we specified {cmd:stdf} to obtain a
confidence interval based on the standard error of the forecast rather than
the standard error of the mean.  This is more useful for identifying outliers.

{pstd}
Note that we typed

	{cmd:. twoway lfitci} ... {cmd:|| scatter} ...

{pstd}
and not

	{cmd:. twoway scatter} ... {cmd:|| lfitci} ...

{pstd}
Had we drawn the scatter diagram first, the confidence interval would
have covered up most of the points.


{marker remarks3}{...}
{title:Cautions}

{pstd}
Do not use {cmd:twoway} {cmd:lfitci} when specifying the
{it:axis_scale_options} {cmd:yscale(log)} or {cmd:xscale(log)} to create log
scales.  Typing

{phang2}
	{cmd:. twoway lfitci mpg weight, stdf || scatter mpg weight ||, xscale(log)}
{p_end}
	  {it:({stata "gr_example auto:twoway lfitci mpg weight, stdf || scatter mpg weight ||, xscale(log)":click to run})}
{* graph gtlfitci4}{...}

{pstd}
The result may look pretty, but, if you think about it, it is not what you
want.  The prediction line is not straight because the regression estimated
for the prediction was for mpg on weight, not for mpg on log(weight).


{marker remarks4}{...}
{title:Use with by()}

{pstd}
{cmd:lfitci} may be used with {cmd:by()} (as can all the {cmd:twoway} plot
commands):

	{cmd}. twoway lfitci  mpg weight, stdf ||
	         scatter mpg weight       ||
          , by(foreign, total row(1)){txt}
	  {it:({stata "gr_example auto: twoway lfitci mpg weight, stdf || scatter mpg weight || , by(foreign, total row(1))":click to run})}
{* graph gtlfitci5}{...}


{title:Also see}

{psee}
Manual:  {bf:[G] graph twoway lfitci}

{psee}
Online:  
{helpb twoway qfitci},
{helpb twoway fpfitci};
{helpb twoway lfit};
{helpb regress}
{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -