Dear Naji,
thank you for your helpful response, could you propose some coding to do
this? for me the question is how to create the variable from the
frequency and then how to attach to dataset B individuals. For instance:
dataset A
tab age gender, cell
egen pctA = ?, by (age gender)
Thank you very much for your help!
Lisa
Lisa,
Make a cross tab (Age and Sex) for each dataset.
The cells are the % over the dataset
DatasetA 20-50 51-70
sex Male 25% 20%
Female 25% 30%
DatasetB 20-50 51-70
sex Male 20% 15%
Female 50% 15%
The weights are the ratio of % datasetB over % dataset A
WeightA 20-50 51-70
sex Male .8 .75
Female 2 .5
If one has a solution for more genral case (say 5 variables, some of the
cross cells are empty..)
thanks for sharing
I have dataset "A" with some distribution of age (in years) and sex
(0,1), and totally unrelated dataset "B" with some different
distribution of age and sex. What is the most parsimonious way to
create an iweight for individuals in dataset B that will give it the
same age and sex distribution of dataset A?
Thank you,
Lisa Jahns
University of North Carolina