📄 impute.hlp
字号:
{smcl}
{* 23feb2005}{...}
{cmd:help impute}{right:dialog: {bf:{dialog impute}}}
{hline}
{title:Title}
{p2colset 5 19 21 2}{...}
{p2col :{hi:[D] impute} {hline 2}}Fill in missing values{p_end}
{p2colreset}{...}
{title:Syntax}
{p 8 15 2}
{cmd:impute}
{depvar}
{indepvars}
{ifin}
{weight}
{cmd:,}
{opt g:enerate(newvar1)}
[{it:options}]
{synoptset 24 tabbed}{...}
{synopthdr}
{synoptline}
{syntab :Main}
{p2coldent :* {opth g:enerate(newvar:newvar1)}}generate
{it:newvar1} to contain the imputations{p_end}
{synopt :{opth nomis:sings(varlist)}}include {it:varlist} without missing values
in the best-subset regressions{p_end}
{synopt :{opt all}}estimate using all observations (regardless of {opt if} and
{opt in}){p_end}
{synopt :{opth reg:sample(exp)}}estimate using observations specified in
{it:exp}{p_end}
{synopt :{opt copy:rest}}copy out-of-sample values of dependent variable to
generated variable{p_end}
{synopt :{opth v:arp(newvar:newvar2)}}create new variable to
contain the variance of the prediction{p_end}
{synoptline}
{p 4 6 2}
* {opt generate(newvar1)} is required.{p_end}
{p 4 4 2}
{it:indepvars} and {it:varlist} may contain time-series operators; see
{help tsvarlist}.{p_end}
{p 4 6 2}{cmd:aweight}s and {cmd:fweight}s are allowed; see {help weight}.{p_end}
{title:Description}
{pstd}{opt impute} fills in missing values; {depvar} is the variable whose
missing values are to be imputed. {indepvars} is the list of variables on
which the imputations are to be based, and {it:{help newvar:newvar1}} is the
new variable that contains the imputations.
{pstd}
{opt impute} organizes the cases
by patterns of missing data so that the missing-value regressions can
be conducted efficiently; this necessitates a limit of 31 variables in
{it:indepvars}.
{pstd}{opt if} {it:exp} and {opt in} {it:range}
restrict the sample in which missings are imputed
and, unless {opt regsample()} or {opt all} are specified, also the sample
used in the regressions.
{title:Options}
{dlgtab:Main}
{phang}{opth "generate(newvar:newvar1)"}
specifies the name of the new variable to be created. {opt generate()} is
required.
{phang}{opth nomissings(varlist)}
specifies the name of variables to include in the best-subset regressions.
This option requires that the specified variables be free of missing
values within the sample of observations used in the regressions.
{phang}{opt all}
specifies that all observations be used in the regression sample.
Thus {opt all} is equivalent to {cmd:regsample(_n<=_N)} or
{cmd:regsample(1)}.
{phang}{opth regsample(exp)}
specifies the sample used to fit regressions. Don't confuse the
{opt if} and {opt in} clauses with the {opt regsample()} option. If
{opt regsample()} is not specified, the regression sample defaults to
all observations if {opt if} and {opt in} are not specified or to
all selected observations, otherwise.
{phang}{opt copyrest}
specifies that out-of-sample values of {depvar} be copied to
the {opt generate()}-d variable. The default is to set out-of-sample
values to missing ({opt .}).
{phang}{opth "varp(newvar:newvar2)"}
specifies the name of a new variable to contain the variance (not the
standard error) of the prediction.
{title:Examples}
{phang2}{cmd:. impute ln_rtl jantemp precip ln_inc medage hhsize, gen(i_ln_rtl)}{p_end}
{phang2}{cmd:. regress ln_eat i_ln_rtl jantemp precip ln_inc medage hhsize}{p_end}
{phang2}{cmd:. factor mpg-foreign}{p_end}
{phang2}{cmd:. score f1 f2}{p_end}
{phang2}{cmd:. impute f1 mpg-foreign, gen(i_f1)}{p_end}
{phang2}{cmd:. impute f2 mpg-foreign, gen(i_f2)}{p_end}
{phang2}{cmd:. regress price i_f1 i_f2}
{pstd}To impute all {cmd:.} missings (and so not the extended missing values
{bind:{hi:.a}, ..., {hi:.z}}) using all valid observations,
{phang2}{cmd:. impute edu xvars if edu==., gen(iedu) all}
{title:Also see}
{psee}
Manual: {bf:[D] impute}
{psee}
Online: {helpb ipolate},
{helpb predict},
{helpb regress}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -