📄 _rmcoll.hlp
字号:
{smcl}
{* 10feb2005}{...}
{cmd:help _rmcoll}, {cmd:help _rmdcoll}
{hline}
{title:Title}
{p2colset 5 20 22 2}{...}
{p2col :{hi:[P] _rmcoll} {hline 2}}Remove collinear variables{p_end}
{p2colreset}{...}
{title:Syntax}
{p 8 16 2}{cmd:_rmcoll} {varlist} {ifin} {weight}
[{cmd:,} {cmdab:nocons:tant}]
{p 8 17 2}{cmd:_rmdcoll} {depvar} {indepvars} {ifin} {weight}
[{cmd:,} {cmdab:nocons:tant} {cmdab:nocol:lin}]
{phang}
{cmd:fweight}s, {cmd:aweight}s, {cmd:iweight}s, and {cmd:pweight}s are
allowed; see {help weight}.
{title:Description}
{pstd}
{cmd:_rmcoll} returns in {hi:r(varlist)} the names of the variables from
the varlist that form a noncollinear set.
{pstd}
If any variables are collinear, in addition to each not being included in
{hi:r(varlist)}, a message is displayed for each:
{pin}Note:{space 2} ______ dropped due to collinearity.
{pstd}
{helpb ml} users: It is not necessary to call {cmd:_rmcoll} because {cmd:ml}
removes the collinear variables for you, assuming that you do not specify
{cmd:ml} {cmd:model}'s {cmd:collinear} option. Even so, {cmd:ml} programmers
sometimes use {cmd:_rmcoll} because they need the noncollinear set of
variables, and, in such cases, they specify {cmd:ml} {cmd:model}'s
{cmd:collinear} option so that {cmd:ml} does not waste time looking for
collinearity again.
{pstd}
{cmd:_rmdcoll} identifies collinearity, including collinearity with the
dependent variable. {cmd:_rmdcoll} returns in {hi:r(varlist)} a variable
list from which collinear variables have been removed and displays the message
{pin}______ collinear with ______
{pstd}
with an error code 459 when the dependent variable is collinear with the
independent variables.
{title:Options}
{phang}
{cmd:noconstant} specifies that, in looking for collinearity, an
intercept should not be included. That is, a variable that contains the same
nonzero value in every observation should not be considered collinear.
{phang}
{cmd:nocollin} specifies that collinear variables have already been removed
from the varlist. Otherwise, {cmd:_rmcoll} is called first to remove any
such collinearity.
{title:Remarks}
{pstd}
{cmd:_rmcoll} and {cmd:_rmdcoll} are typically used when writing estimation
commands.
{pstd}
{cmd:_rmcoll} is used if the programmer wants to drop the collinear variables
from the independent variables.
{pstd}
{cmd:_rmdcoll} is used if the programmer wants to detect the collinearity
of the dependent variable with the independent variables.
{pstd}
A code fragment for the caller of {cmd:_rmcoll} might read as
{it:...}
{cmd:syntax varlist [fweight iweight]} {it:...} {cmd:[, noCONStant} {it:...} {cmd:]}
{cmd:marksample touse}
{cmd:if "`weight'" != "" {c -(}}
{cmd:tempvar w}
{cmd:quietly gen double `w' = `exp' if `touse'}
{cmd:local wgt [`weight'=`w']}
{cmd:{c )-}}
{cmd:else local wgt} {it:/* is nothing */}
{cmd:tokenize `varlist'}
{cmd:local depvar `1'}
{cmd:mac shift}
{cmd:_rmcoll `*' `wgt' if `touse', `constant'}
{cmd:local xvars `r(varlist)'}
{it:...}
{pstd}
In this code fragment, {cmd:`varlist'} contains a single dependent variable
and zero or more independent variables. The dependent variable is split off
and stored in the local macro {cmd:depvar}. Then the remaining variables are
passed through {cmd:_rmcoll}, and the resulting noncollinear set stored in
the local macro {cmd:xvars}.
{title:Also see}
{psee}
Manual: {bf:[P] _rmcoll}
{psee}
Online: {helpb ml}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -