📄 vwls.hlp
字号:
{smcl}
{* 17mar2005}{...}
{cmd:help vwls}{right:dialog: {bf:{dialog vwls}}{space 15}}
{right:also see: {help vwls postestimation}}
{hline}
{title:Title}
{p2colset 5 17 19 2}{...}
{p2col :{hi:[R] vwls} {hline 2}}Variance-weighted least squares{p_end}
{p2colreset}{...}
{title:Syntax}
{p 8 16 2}
{cmd:vwls} {depvar} {indepvars} {ifin} {weight}
[{cmd:,} {it:options}]
{synoptset 14 tabbed}{...}
{synopthdr:options}
{synoptline}
{syntab:Model}
{synopt :{opt nocon:stant}}suppress constant term{p_end}
{synopt :{opth sd(varname)}}variable containing estimate of conditional
standard deviation{p_end}
{syntab:Reporting}
{synopt :{opt l:evel(#)}}set confidence level; default is {cmd:level(95)}{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}{cmd:bootstrap}, {cmd:by}, {cmd:jackknife}, {cmd:rolling},
{cmd:statsby}, and {cmd:xi} are allowed; see {help prefix}.{p_end}
{p 4 6 2}{cmd:fweight}s are allowed; see {help weight}.{p_end}
{p 4 6 2}See {help vwls postestimation} for additional capabilities of
estimation commands.{p_end}
{title:Description}
{pstd}
{cmd:vwls} estimates a linear regression using variance-weighted least
squares. It differs from ordinary least-squares (OLS) regression in that it
does not assume homogeneity of variance, but requires that the conditional
variance of {depvar} be estimated prior to the regression. The estimated
variance need not be constant across observations. {cmd:vwls} treats the
estimated variance as if it were the true variance when it computes standard
errors of the coefficients.
{pstd}
You must supply an estimate of the conditional standard deviation of {depvar}
to {cmd:vwls} using the {opth sd(varname)} option, or you must have grouped
data with groups defined by the {indepvars} variables. In the latter case,
{cmd:vwls} treats all {it:indepvars} as categorical variables, computes the
mean and standard deviation of {it:depvar} separately for each subgroup; and
computes the regression of the subgroup means on {it:indepvars}.
{pstd}
The first consists of measurements from physical science experiments in
which all error is due solely to measurement error and the sizes of the
measurement errors are known.
{pstd}
The second concerns certain categorical data analyses. The independent
variables are categorical and the outcome can be sensibly averaged. Assuming
each of the subgroups defined by the independent variables contains a
reasonable number of subjects, then the variance of the outcome variable can
be estimated independently within each group.
{pstd}
{cmd:regress} with analytic weights can be used to produce another kind of
"variance-weighted least squares"; see the following remarks for an
explanation of the difference.
{title:Options}
{dlgtab:Model}
{phang}
{opt noconstant}; see {help estimation options##noconstant:estimation options}.
{phang}
{opth sd(varname)} specifies an estimate of the conditional standard deviation
of {depvar} (that is, it can vary observation by observation). All values of
{it:varname} must be > 0. If you specify {opt sd()}, you cannot use
{cmd:fweight}s.
{pmore}
If {opt sd()} is not given, the data will be grouped by {indepvars}. In this
case, {it:indepvars} are treated as categorical variables, and the means and
standard deviations of {it:depvars} for each subgroup are calculated and used
for the regression. Any subgroup for which the standard deviation is zero is
dropped.
{dlgtab:Reporting}
{phang}
{opt level(#)}; see {help estimation options##level():estimation options}.
{title:Example}
{bf:Example 1}
{pmore}
An experimenter measures the quantities {cmd:x} and {cmd:y} and estimates that
the standard deviation of each {cmd:y} measurement is {cmd:stderr}:
{cmd:x y stderr}
{hline 19}
1 1.2 0.5
3 3.2 1.0
4 4.3 1.0
...
{phang3}{cmd:. vwls y x, sd(stderr)}
{bf:Example 2}
{phang3}. vwls bp gender race
{pmore}
where {cmd:gender} and {cmd:race} are categorical (0/1) variables. If
{cmd:race} were a categorical variable taking on three values,
{phang3}{cmd:. xi: vwls bp gender i.race}
{pmore}
See {helpb xi}.
{title:Also see}
{psee}
Manual: {bf:[R] vwls}
{psee}
Online: {help vwls postestimation};{break}
{helpb regress}{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -