📄 twoway_fpfit.hlp
字号:
{smcl}
{* 08apr2005}{...}
{cmd:help twoway fpfit} {right:dialogs: {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 31 33 2}{...}
{p2col :{hi:[G] graph twoway fpfit} {hline 2}}Twoway fractional-polynomial prediction plots{p_end}
{p2colreset}{...}
{title:Syntax}
{p 8 60 2}
{cmdab:tw:oway}
{cmd:fpfit}
{it:yvar} {it:xvar}
{ifin}
{weight}
[{cmd:,}
{it:options}]
{p2colset 9 38 40 2}{...}
{it:options}{col 38}description
{hline 70}
{cmdab:estc:md:(}{it:estcmd}{cmd:)}{...}
{col 38}estimation command; default is {cmd:regress}
{cmdab:est:opts:(}{it:fracpoly_options}{cmd:)}{...}
{col 38}options for {cmd:fracpoly} {it:estcmd}
{cmdab:pred:opts:(}{it:predict_options}{cmd:)}{...}
{col 38}options for {cmd:predict}
{it:{help cline_options}}{...}
{col 38}change look of predicted line
INCLUDE help gr_axlnk
INCLUDE help gr_twopt
{hline 70}
{pin}
Options {cmd:estcmd()}, {cmd:estopts()},
and {cmd:predopts()} are {it:unique}; see {help repeated options}.
{phang}
{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:fpfit} calculates the prediction for {it:yvar} based on
estimation of a fractional polynomial of {it:xvar} and plots the resulting
curve.
{title:Options}
{phang}
{cmd:estcmd(}{it:estcmd}{cmd:)}
specifies the estimation command to be used;
{cmd:estcmd(regress)} is the default.
{phang}
{cmd:estopts(}{it:fracpoly_options}{cmd:)}
specifies options to be passed along to {cmd:fracpoly} to
estimate the fractional polynomial regression from which the curve will be
predicted; see {helpb fracpoly}.
{phang}
{cmd:predopts(}{it:predict_options}{cmd:)}
specifies options to be passed along to {cmd:predict} to
obtain the predictions after estimation by {cmd:fracpoly} {cmd:regress}.
{cmd:predopts()} may only be used with {cmd:estcmd(regress)}.
Predictions in all cases are calculated at all the {it:xvar} values
in the data.
{phang}
{it:cline_options}
specify how the prediction line is rendered; see {it:{help cline_options}}.
INCLUDE help gr_axlnkf
INCLUDE help gr_twoptf
{title:Remarks}
{pstd}
Remarks are presented under the headings
{help twoway fpfit##remarks1:Typical use}
{help twoway fpfit##remarks2:Cautions}
{help twoway fpfit##remarks3:Use with by()}
{marker remarks1}{...}
{title:Typical use}
{pstd}
{cmd:twoway} {cmd:fpfit} is nearly always used in conjunction with
other {cmd:twoway} plottypes, such as
{cmd:. sysuse auto, clear}
{cmd:. scatter mpg weight || fpfit mpg weight}
{it:({stata "gr_example auto: scatter mpg weight || fpfit mpg weight":click to run})}
{* graph gtfpfit1}{...}
{pstd}
Results are visually the same as typing
{cmd}. fracpoly regress mpg weight
. predict fitted
. scatter mpg weight || line fitted weight{txt}
{marker remarks2}{...}
{title:Cautions}
{pstd}
Do not use {cmd:twoway} {cmd:fpfit} when specifying the
{it:axis_scale_options} {cmd:yscale(log)} or {cmd:xscale(log)} to create log
scales. Typing
{phang2}
{cmd:. scatter mpg weight, xscale(log) || fpfit mpg weight}
{pstd}
will produce a curve that will be fitted from a fractional polynomial
regression of mpg on weight rather than log(weight).
{marker remarks3}{...}
{title:Use with by()}
{pstd}
{cmd:lfit} may be used with {cmd:by()} (as can all the {cmd:twoway} plot
commands):
{phang2}
{cmd:. scatter mpg weight || fpfit mpg weight ||, by(foreign, total row(1))}
{p_end}
{it:({stata "gr_example auto: scatter mpg weight || fpfit mpg weight ||, by(foreign, total row(1))":click to run})}
{* graph gtfpfit2}{...}
{title:Also see}
{psee}
Manual: {bf:[G] graph twoway fpfit}
{psee}
Online:
{helpb line},
{helpb twoway fpfitci};
{helpb twoway lfit},
{helpb twoway qfit};
{helpb twoway mband},
{helpb twoway mspline};
{helpb fracpoly}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -