Mark: This is a survey data. every observation represents a certain
number of
persons in the population. all the weights in the dataset addup to the
whole
population. So the pweight is the weight I will use, isn't it?
Kit: Do I need to consider the weights while I am doing the demeaning?
ie. when
I calculate the mean of a variable, should I use the sum of variables
divided by
the number of oberservations, or should I use the sum of the products
of the
variable and weight, then divide the sum by the total weights? I hope
I've made
myself clear.
To answer the first question, NO, these smell like classic frequency
weights to me. As for the second, you can do the weighting in Jann's
center command:
webuse census2
center medage [fw=pop]
In my understanding that will give you a demeaned, appropriately
weighted median age variable.