I want to generate a variable indicating the highest age of either a mother or father. Specifically, that variable would take a value of 1 if either age of father is older than that of mother or vice versa.
Here is my data example. Thank you.
Code:
clear input int id long(fage mage) 1 89 83 3 . 84 5 80 77 7 . 74 8 . 90 15 . 83 16 . 82 24 . 85 26 . 91 30 85 80 34 89 89 36 . 88 40 . 86 41 . 90 43 93 74 44 . 85 45 75 74 46 . 93 54 . 75 67 . 96 68 . 89 72 . 89 73 . 90 74 . 82 75 . 84 77 82 80 79 . 83 81 . 90 83 79 76 95 . 79 97 . 80 98 . 96 99 . 87 103 . 91 104 . 89 105 80 78 109 81 80 110 . 88 111 . 84 112 . 79 113 . 80 120 . 86 122 83 77 125 . 91 127 81 83 131 . 87 132 85 82 133 . 91 135 87 81 138 83 83 139 86 78 145 84 79 146 . 92 149 . 82 151 . 86 154 . 93 158 . 82 163 . 91 164 . 95 165 . 78 169 . 82 170 . 94 173 86 84 174 90 84 177 . 78 178 . 88 179 . 86 182 . 74 188 . 96 193 85 78 199 . 87 200 . 82 206 . 92 211 . 85 216 . 81 217 84 80 218 82 76 221 . 82 222 . 76 224 . 88 225 . 83 230 . 86 231 . 96 241 . 83 244 . 84 245 . 76 247 . 78 248 . 88 250 . 80 253 . 83 260 78 85 262 . 87 263 . 82 264 81 77 268 . 76 273 . 84 276 74 74 277 . 85 281 . 83 283 . 77 end
0 Response to How to generate a variable indicating the highest age of either a mother or father?
Post a Comment