📄 glm_postestimation.hlp
字号:
{smcl}
{* 22mar2005}{...}
{cmd:help glm postestimation}{right:dialogs: {bf:{dialog glim_p:predict}}}
{right:also see: {helpb glm}{space 4}}
{hline}
{p2colset 5 31 33 2}{...}
{p2col :{hi:[R] glm postestimation} {hline 2}}Postestimation tools for glm{p_end}
{p2colreset}{...}
{title:Description}
{pstd}
The following postestimation commands are available for {opt glm}:
{synoptset 13 tabbed}{...}
{p2coldent :command}description{p_end}
{synoptline}
INCLUDE help post_adjust2star
INCLUDE help post_estat
INCLUDE help post_estimates
INCLUDE help post_lincom
INCLUDE help post_linktest
INCLUDE help post_lrtest
INCLUDE help post_mfx
INCLUDE help post_nlcom
{synopt :{helpb glm 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}
{p2colreset}{...}
{p 4 6 2}* {cmd:adjust} does not work with time-series operators.
{marker predict}{...}
{title:Syntax for predict}
{p 8 16 2}
{cmd:predict}
{dtype}
{newvar}
{ifin}
[{cmd:,} {it:{help glm postestimation##statistic:statistic}}
{it:{help glm postestimation##options:options}}]
{synoptset 16 tabbed}{...}
{marker statistic}{...}
{synopthdr :statistic}
{synoptline}
{syntab :Main}
{synopt :{opt m:u}}g_inverse(xb); the default{p_end}
{synopt :{opt xb}}the linear prediction{p_end}
{synopt :{opt e:ta}}synonym of {opt xb}{p_end}
{synopt :{opt stdp}}standard error of the linear prediction{p_end}
{synopt :{opt a:nscombe}}Anscombe residuals{p_end}
{synopt :{opt c:ooksd}}Cook's distance{p_end}
{synopt :{opt d:eviance}}deviance residuals{p_end}
{synopt :{opt h:at}}diagonals of the "hat" matrix{p_end}
{synopt :{opt l:ikelihood}}a weighted average of standardized deviance and standardized Pearson residuals{p_end}
{synopt :{opt p:earson}}Pearson residuals{p_end}
{synopt :{opt r:esponse}}differences between the observed and fitted
outcomes{p_end}
{synopt :{opt s:core}}first derivative of the log likelihood with respect to
xb{p_end}
{synopt :{opt w:orking}}working residuals{p_end}
{synoptline}
{p2colreset}{...}
{synoptset 16 tabbed}{...}
{marker options}{...}
{synopthdr}
{synoptline}
{syntab :Options}
{synopt :{opt nooff:set}}modify calculations to ignore offset variable{p_end}
{synopt :{opt sta:ndardized}}multiply residual by the factor (1-h)^[-1/2]{p_end}
{synopt :{opt stu:dentized}}multiply residual by one over the square root of
the estimated scale parameter{p_end}
{synopt :{opt mod:ified}}modify denominator of residual to be a reasonable
estimate of the variance of {depvar}{p_end}
{synopt :{opt adj:usted}}adjust deviance residual to speed up
convergence{p_end}
{p2line}
{p2colreset}{...}
INCLUDE help esample
{title:Options for predict}
{dlgtab:Main}
{phang}
{opt mu}, the default, specifies that {opt predict} calculate the inverse link
of the linear prediction.
{phang}
{opt xb} calculates the linear prediction.
{phang}
{opt eta} is a synonym for {opt xb}.
{phang}
{opt stdp} calculates the standard error of the linear predictor.
{phang}
{opt anscombe} calculates the Anscombe residuals to produce residuals that
closely follow a normal distribution.
{phang}
{opt cooksd} calculates Cook's distance, which measures the aggregate change
in the estimated coefficients when each observation is left out of the
estimation.
{phang}
{opt deviance} calculates the deviance residuals. Deviance residuals are
recommended by McCullagh and Nelder and by others as having the best
properties for examining the goodness of fit of a GLM. They are approximately
normally distributed if the model is correct. They may be plotted against
fitted values or against a covariate to inspect the model's fit. Also see the
{opt pearson} option below.
{phang}
{opt hat} calculates the diagonals of the "hat" matrix as an analog to simple
linear regression.
{phang}
{opt likelihood} calculates a weighted average of standardized deviance
and standardized Pearson residuals.
{phang}
{opt pearson} calculates the Pearson residuals. Be aware that Pearson
residuals often have markedly skewed distributions for non-normal family
distributions. Also see the {opt deviance} option above.
{phang}
{opt response} calculates the differences between the observed and
fitted outcomes.
{phang}
{opt score} calculates the equation-level score; the derivative of the log
likelihood with respect to the linear prediction.
{phang}
{opt working} calculates the working residuals, which are response residuals
weighted according to the derivative link function.
{dlgtab:Options}
{phang}
{opt nooffset} is relevant only if you specified
{opth offset(varname)} for {opt glm}. It modifies the calculations made by
{opt predict} so that they ignore the offset variable; the linear prediction
is treated as xb rather than xb + offset.
{phang}
{opt standardized} requests that the residual be multiplied by the
factor {bind:(1-h)^[-1/2]}, where h is the diagonal of the hat matrix.
This is done to account for the correlation between {depvar} and its predicted
value.
{phang}
{opt studentized} requests that the residual be multiplied by one over
the square root of the estimated scale parameter.
{phang}
{opt modified} requests that the denominator of the residual be
modified to be a reasonable estimate of the variance of {depvar}.
The base residual is multiplied by the factor (k/w)^[-1/2], where k is
either one or the user-specified dispersion parameter, and w is the
specified weight (or one if left unspecified).
{phang}
{opt adjusted} adjusts the deviance residual to speed up the
convergence to the limiting normal distribution.
The adjustment deals with adding to the deviance residual a higher-order term
that depends on the variance function family. This option is only allowed
when {opt deviance} is specified.
{title:Examples}
{phang}{cmd:. glm r ldose, f(binomial n) l(logit)}{p_end}
{phang}{cmd:. predict mu_logit}{p_end}
{phang}{cmd:. predict dr_logit, deviance}{p_end}
{title:Also see}
{psee}
Manual: {bf:[R] glm postestimation}
{psee}
Online: {helpb glm};{break}
{helpb adjust},
{helpb estimates},
{helpb lincom},
{helpb linktest},
{helpb lrtest},
{helpb mfx},
{helpb nlcom},
{helpb predictnl},
{help regress postestimation},
{helpb suest},
{helpb test},
{helpb testnl}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -