Hi everyone. I am struggling with a function of Stata which I am not able to use on my dataset. It is the function "survwgt rake". I used it in this way:
survwgt rake startingweight, by(sex people14 people1524 people2554 people5564 people65) totvar(sexweight ageweight14 ageweight1524 ageweight2554 ageweight5564 ageweight65) generate(newwgt)
where startingweight is equal to 1 because each individual has the same weight.
Sex is a dummy variable =0 for females and =1 for males.
People14 is another dummy =0 for those who are older than 14 and =1 for those who are younger, and so on for each "people" dummy.
Sexweight is the real weight of male and female in our society. Ageweight14 is the portion of individuals younger than 15 in the society and so on...
What I would like to find is a single variable (newwgt) which is the weight of individuals who completed the survey.
However, Stata says:
totals across dimensions 1 and 2 are not equal
r(199);"
Do you have an idea why it does not work?
Thanks a lot
survwgt rake startingweight, by(sex people14 people1524 people2554 people5564 people65) totvar(sexweight ageweight14 ageweight1524 ageweight2554 ageweight5564 ageweight65) generate(newwgt)
where startingweight is equal to 1 because each individual has the same weight.
Sex is a dummy variable =0 for females and =1 for males.
People14 is another dummy =0 for those who are older than 14 and =1 for those who are younger, and so on for each "people" dummy.
Sexweight is the real weight of male and female in our society. Ageweight14 is the portion of individuals younger than 15 in the society and so on...
What I would like to find is a single variable (newwgt) which is the weight of individuals who completed the survey.
However, Stata says:
totals across dimensions 1 and 2 are not equal
r(199);"
Do you have an idea why it does not work?
Thanks a lot
Comment