I have to "develop person weights from the age and sex variables using an iterative proportional fitting process with the variables of age and sex".

I never did this before, so any suggestion will be highly appreciated!


Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte age str6 sex int systolicbp 
49 "male"   134
41 "male"   158
46 "female" 158
63 "male"   157
24 "female" 157
23 "female" 157
46 "male"   157
67 "female" 118
59 "male"   160
46 "female" 157
19 "female"   .
59 "female" 168
62 "male"   131
53 "female" 164
49 "male"   118
37 "female" 172
31 "male"     .
66 "male"   136
54 "female" 169
27 "male"     .
23 "male"   142
35 "male"   102
32 "male"   134
61 "male"   137
31 "male"   160
63 "female" 164
25 "female" 112
66 "female" 142
69 "male"     .
21 "male"   148
43 "male"   159
39 "male"   142
37 "female"   .
45 "male"   161
62 "male"   119
34 "male"   153
60 "male"     .
42 "female"   .
48 "female" 119
60 "female" 176
53 "female" 163
22 "male"   147
46 "male"   175
60 "female" 148
68 "male"   146
63 "female" 162
59 "female" 151
64 "female" 106
71 "female"   .
48 "female" 139
55 "male"   132
25 "male"   151
32 "male"   131
56 "female" 150
19 "male"   147
60 "female" 108
32 "female" 119
21 "female" 108
60 "female" 117
71 "male"   151
69 "female" 139
24 "female"   .
26 "male"   116
30 "male"   112
61 "female" 170
67 "female" 112
53 "male"   165
44 "female" 170
48 "female" 153
43 "male"   120
22 "female" 102
57 "female" 115
22 "female" 164
38 "male"   150
50 "female" 161
60 "male"   103
54 "female"   .
29 "male"   147
31 "female" 124
55 "female" 127
31 "female" 166
54 "male"   162
68 "male"   161
32 "female" 159
23 "male"   159
37 "female" 141
72 "female" 119
58 "male"   115
64 "male"   176
37 "female" 129
35 "female" 104
47 "female" 104
34 "male"   116
27 "female" 165
61 "male"     .
46 "male"   138
47 "male"   160
72 "male"   126
47 "female" 172
61 "female" 140
end