Re: Haz weighted mean [message #7012 is a reply to message #7009] |
Mon, 10 August 2015 14:00 |
Reduced-For(u)m
Messages: 292 Registered: March 2013
|
Senior Member |
|
|
I think you are confusing two types of weights here. The DHS weights are essentially "probability" weights that re-weight the sample to be representative. In the mapping you describe, I think you want "frequency" weights - you want the marker/circle size to be bigger if there are more observations, yes?
In that case, you want to weight by the number of observations, so all you have to do is count them up. You can do this with a "collapse" command if that is how you are calculating cluster-level averages (see the Stata help file for collapse), or you can use an "egen" command such as:
egen N_obs = count(HAZ), by(clusterid)
Is that what you wanted to do? If you wanted to show the "relative weight" that each cluster was getting as your marker size, you could do about what you described:
even map_weight = sum(old_weight), by(clusterid)
These should be very similar (as in, the ratio of the sum of weights between two clusters will be fairly close to the ratio of the number of observations).
|
|
|