⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 weight.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 05apr2005}{...}
{cmd:help weight}
{hline}

{title:Title}

{pstd}
{hi:[U] 11.1.6 weight} {hline 2} Weights


{title:Remarks}

{pstd}
Most Stata commands can deal with weighted data.  Stata allows four kinds of
weights:

{p 4 8 2}1.  {cmd:fweight}s, or frequency weights, are weights that
indicate the number of duplicated observations.

{p 4 8 2}2.  {cmd:pweight}s, or sampling weights, are weights that denote
the inverse of the probability that the observation is included due to the
sampling design.

{p 4 8 2}3.  {cmd:aweight}s, or analytic weights, are weights that are
inversely proportional to the variance of an observation; i.e., the variance
of the j-th observation is assumed to be sigma^2/w_j, where w_j are the
weights.  Typically, the observations represent averages and the weights are
the number of elements that gave rise to the average.  For most Stata
commands, the recorded scale of {cmd:aweight}s is irrelevant; Stata internally
rescales them to sum to N, the number of observations in your data, when it
uses them.

{p 4 8 2}4.  {cmd:iweight}s, or importance weights, are weights that
indicate the "importance" of the observation in some vague sense.
{cmd:iweight}s have no formal statistical definition; any command that
supports {cmd:iweight}s will define exactly how they are treated.  In most
cases, they are intended for use by programmers who want to produce a certain
computation.

{pstd}
You have some variable in your data that contains the weight.  The general
syntax is

{p 12 12 2}
{it:command} {it:...} {cmd:[}{it:weighttype}{cmd:=}{it:varname}{cmd:]} {it:...}

    For example:

{phang2}{cmd:. anova y x1 x2 x1*x2 [fweight=pop]}

{phang2}{cmd:. regress avgy avgx1 avgx2 [aweight=cellpop]}

{phang2}{cmd:. regress y x1 x2 x3 [pweight=1/prob]}

{phang2}{cmd:. scatter y x [aweight=y2], mfcolor(none)}

{pstd}
Note that you type the square brackets.

{pstd}
Stata allows abbreviations; {cmd:fw} for {cmd:fweight}, {cmd:aw} for
{cmd:aweight}, and so on.  You could type

{phang2}{cmd:. anova y x1 x2 x1*x2 [fw=pop]}

{phang2}{cmd:. regress avgy avgx1 avgx2 [aw=cellpop]}

{phang2}{cmd:. regress y x1 x2 x3 [pw=1/prob]}

{phang2}{cmd:. scatter y x [aw=y2], mfcolor(none)}

{pstd}
In addition, each command has its own idea of the "natural" kind of weight.
If you type

{phang2}{cmd:. regress avgy avgx1 avgx2 [w=cellpop]}

{pstd}
the command will tell you what kind of weight it is assuming and perform
the request as if you specified that kind of weight.

{pstd}
There are synonyms for some of the weight types.  {cmd:fweight} can also be
referred to as {cmd:frequency} (abbreviation {cmd:freq}).  {cmd:aweight} can
be referred to as {cmd:cellsize} (abbreviation {cmd:cell}):

{phang2}{cmd:. anova y x1 x2 x1*x2 [freq=pop]}

{phang2}{cmd:. regress avgy avgx1 avgx2 [cell=cellpop]}


{title:{cmd:fweight}s}

{pstd}
Frequency {cmd:fweight}s indicate replicated data.  The weight tells the
command how many observations each observation really represents.
{cmd:fweight}s allow data to be stored more parsimoniously.  The weighting
variable contains positive integers.  The result of the command is the same as
if you duplicated each observation however many times and then ran the command
unweighted.


{title:{cmd:pweight}s}

{pstd}
Sampling {cmd:pweight}s indicate the inverse of the probability that this
observation was sampled.  Commands that allow {cmd:pweight}s typically provide
a {cmd:cluster()} option.  These can be combined to produce estimates for
unstratified cluster-sampled data.  If you must also deal with issues of
stratification, see {help survey}.


{title:{cmd:aweight}s}

{pstd}
Analytic {cmd:aweight}s are typically appropriate when you are dealing with
data containing averages.  For instance, you have average income and average
characteristics on a group of people.  The weighting variable contains the
number of persons over which the average was calculated (or a number
proportional to that amount).


{title:{cmd:iweight}s}

{pstd}
This weight has no formal statistical definition and is a catch-all
category.  The weight somehow reflects the importance of the observation and
any command that supports such weights will define exactly how such weights
are treated.


{title:Also see}

{psee}
Manual:  {bf:[U] 11 Language syntax},{break}
{bf:[U] 11.1.6 weight},{break}
{bf:[U] 20.16 Weighted estimation},{break}
{bf:[SVY] survey}

{psee}
Online:  {help language}, {help survey}
{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -