[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Re: Weighted number of observations
Dear Friedrich Huebler
You wrote about
> . tabstat foreign [aw=weight], stat(sum)
> variable | sum
> foreign | 50950
Perhaps I miss the point, but,
.gen eachmean = foreign*weight
.gen sumeachmean = sum(eachmean) /* I don't know the mean of this. */
. list sumeachmean in l
| sumeac~n |
74. | 50950 |
This seems to agree with the definition of the aweight.
[Online help says,]
aweights, 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.
> The Stata User's Guide states in section 14.1.6: "For most Stata
> commands, the recorded scale of aweights is irrelevant; Stata
> internally rescales them to sum to N, the number of observations in
> your data, when it uses them." It would be useful if the Stata
> documentation could make clear which commands don't use aweights in
> this manner.
> Friedrich Huebler
* For searches and help try: