📄 truncreg_postestimation.hlp
字号:
{smcl}
{* 03apr2005}{...}
{cmd:help truncreg}{...}
{right:dialog: {bf:{dialog truncr_p:predict}} }
{right:also see: {helpb truncreg}}
{hline}
{title:Title}
{p2colset 5 37 39 2}{...}
{p2col:{hi:[R] truncreg postestimation} {hline 2}}Postestimation tools for
truncreg{p_end}
{p2colreset}{...}
{title:Description}
{pstd}
The following postestimation commands are available for {opt truncreg}:
{synoptset 13 tabbed}{...}
{synopthdr:command}
{synoptline}
INCLUDE help post_adjust1star
INCLUDE help post_estat
INCLUDE help post_estimates
INCLUDE help post_lincom
INCLUDE help post_lrtest
INCLUDE help post_mfx
INCLUDE help post_nlcom
{p2col :{helpb truncreg postestimation##predict:predict}}predictions, residuals, influence statistics, and other diagnostic measures{p_end}
INCLUDE help post_predictnl
INCLUDE help post_suest
INCLUDE help post_test
INCLUDE help post_testnl
{synoptline}
{p 4 6 2}
* {opt adjust} does not work with time-series operators.{p_end}
{marker predict}{...}
{title:Syntax for predict}
{p 8 16 2}
{cmd:predict}
{dtype}
{newvar}
{ifin}
[{cmd:,} {it:statistic} {opt nooff:set}]
{p 8 16 2}
{cmd:predict}
{dtype}
{c -(}{it:stub*}|{it:newvar_reg} {it:newvar_sigma}{c )-}
{ifin}
{cmd:,} {opt sc:ores}
{synoptset 13 tabbed}{...}
{synopthdr}
{synoptline}
{syntab:Main}
{synopt:{opt xb}}fitted values; the default{p_end}
{synopt:{opt p:r(a,b)}}Pr(a < y <b){p_end}
{synopt:{opt e(a,b)}}E(y | a < y < b){p_end}
{synopt:{opt y:star(a,b)}}E(y*),y* = max{c -(}a, min(y,b){c )-} {p_end}
{synopt:{opt stdp}}standard error of the prediction{p_end}
{synopt:{opt stdf}}standard error of the forecast{p_end}
{synoptline}
{p2colreset}{...}
INCLUDE help esample
INCLUDE help whereab
{title:Options for predict}
{dlgtab:Main}
{phang}
{opt xb}, the default, calculates the fitted values.
{phang}
{opt pr(a,b)} calculates {bind:Pr({it:a} < xb + u < {it:b})},
the probability that y|x would be observed in the interval ({it:a},{it:b}).
{pmore}
{it:a} and {it:b} may be specified as numbers or variable names;
lb and ub are variable names;{break}
{cmd:pr(20,30)} calculates {bind:Pr(20 < xb + u < 30)};{break}
{cmd:pr(lb,ub)} calculates {bind:Pr(lb < xb + u < ub)}; and{break}
{cmd:pr(20,ub)} calculates {bind:Pr(20 < xb + u < ub)}.
{pmore}
{it:a} missing {bind:({it:a} {ul:>} .)} means minus infinity;
{cmd:pr(.,30)} calculates {bind:Pr(xb + u < 30)};
{cmd:pr(lb,30)} calculates {bind:Pr(xb + u < 30)} in observations for which
{bind:lb {ul:>} .} and calculates {bind:Pr(lb < xb + u < 30)} elsewhere.
{pmore}
{it:b} missing {bind:({it:b} {ul:>} .)} means plus infinity;
{cmd:pr(20,.)} calculates {bind:Pr(xb + u > 20)};
{cmd:pr(20,ub)} calculates {bind:Pr(xb + u > 20)} in observations for which
{bind:ub {ul:>} .} and calculates {bind:Pr(20 < xb + u < ub)} elsewhere.
{phang}
{opt e(a,b)} calculates
{bind:E(xb+u | {it:a} < xb + u < {it:b})}, the expected value of y|x conditional
on y|x being in the interval ({it:a},{it:b}), meaning that y|x is censored.
{it:a} and {it:b} are specified as they are for {opt pr()}.
{phang}
{opt ystar(a,b)} calculates E(y*),
where {bind:y* = {it:a}} if {bind:xb + u {ul:<} {it:a}}, {bind:y* = {it:b}} if
{bind:xb + u {ul:>} {it:b}}, and {bind:y* = xb + u} otherwise, meaning that
y* is truncated. {it:a} and {it:b} are specified as they are for
{opt pr()}.
{phang}
{opt stdp} calculates the standard error of the prediction, which can be
thought of as the standard error of the predicted expected value or mean for
the observation's covariate pattern. This is also referred to as the standard
error of the fitted value.
{phang}
{opt stdf} calculates the standard error of the forecast, which is the
standard error of the point prediction for a single observation. It is
commonly referred to as the standard error of the future or forecast value.
By construction, the standard errors produced by {opt stdf} are always larger
than those produced by {opt stdp}; see {helpb regress}.
{phang}
{opt nooffset} is relevant only if you specified {opth offset(varname)}.
It modifies the calculations made
by {helpb predict} so that they ignore the offset variable; the linear
prediction is treated as xb rather than xb + offset.
{phang}
{opt scores} calculates equation-level score variables.
{pmore}
The first new variable will contain the derivative of the log likelihood with
respect to the regression equation.
{pmore}
The second new variable will contain the derivative of the log likelihood with
respect to the scale equation ({hi:sigma}).
{title:Examples}
{phang}{cmd:. truncreg price mpg for, ll(4000) ul(10000)}{p_end}
{phang}{cmd:. predict truncp, ystar(4000, 10000)}{p_end}
{phang}{cmd:. predict linp, xb}{p_end}
{title:Also see}
{psee}
Manual: {bf:[R] truncreg postestimation}
{psee}
Online: {helpb truncreg};{break}
{helpb adjust},
{helpb estimates},
{helpb lincom},
{helpb lrtest},
{helpb mfx},
{helpb predictnl},
{helpb suest},
{helpb test},
{helpb testnl}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -