Hi folks, give the data below, i would like to produce a similar table as shown in the image attached. Specifically, i want each column to have the median value by racial group and each row is a given year. Thanks in advance Array
Code:
 * Example generated by -dataex-. To install: ssc install dataex clear input int(weight year) byte age str6 sex str14 education str8 marital_status long total_assets double asset_housing long total_debt double(debt_housing annual_income) 5211 1990 35 "female" "no college"     "single"     4483        0  52628        0  9737.17 6397 1990 35 "female" "no college"     "married"  418280        0 101747        0  11684.6 7956 1990 40 "male"   "no college"     "other"    959637 139939.5  86358  18658.6 83739.63 2392 1990 51 "female" "no college"     "married"  107584  18658.6  30729  5597.58 19474.33 1535 1990 28 "male"   "no college"     "married"  498127 33585.48  13987 20524.46  35053.8 1391 1990 32 "male"   "no college"     "other"    489791   9329.3  30799        0  11684.6 3473 1990 33 "male"   "no college"     "other"    562332  27987.9  74823  7463.44 21421.77 7055 1990 52 "male"   "no college"     "married"  289281  55975.8 133806        0  29211.5 7430 1990 62 "male"   "no college"     "married"  334539  74634.4 152246        0 19474.33 6539 1990 63 "female" "no college"     "single"   509430        0  77863        0   5842.3 1355 1990 21 "female" "no college"     "married"  705974        0  46164        0  7789.73 9167 1990 35 "female" "college degree" "married"  337039 177256.7 151966        0 56475.57 3804 1990 27 "male"   "no college"     "married"  917490 167927.4 135473 139939.5 72055.03 4990 1990 43 "female" "no college"     "married"  693985        0 168271        0 19474.33 3255 1991 30 "female" "no college"     "married"  853179        0 123049        0 15579.47 5350 1991 23 "male"   "no college"     "married"  359235  3731.72 140037        0 15579.47 7085 1991 56 "female" "no college"     "married"  496026        0 149933        0 15579.47 3715 1991 43 "male"   "no college"     "single"   698656        0 112722        0  52580.7 8339 1991 70 "female" "no college"     "single"   819018        0 120129        0  9737.17 3869 1991 50 "male"   "no college"     "single"   159206  55975.8  60112        0 38948.67 1802 1991 75 "male"   "no college"     "single"    30351  55975.8 156893        0  46738.4 8097 1991 52 "male"   "college degree" "single"   498698 149268.8 130972 95158.86 101266.5 9360 1991 44 "female" "no college"     "single"   639472        0  47124        0  11684.6 1494 1991 55 "male"   "no college"     "single"   661929        0 105221        0        0 4689 1991 22 "female" "no college"     "married"  992707        0  80804        0  9737.17 5660 1991 64 "male"   "no college"     "single"   907044 149268.8  89450        0   116846 8016 1991 38 "male"   "some college"   "married"  727705  3731.72 103053        0 19474.33 2091 1991 30 "female" "no college"     "other"    493152  27987.9  75389 14926.88 42843.53 8326 1991 62 "male"   "no college"     "married"  831427  3731.72  66744        0  11684.6 9007 1991 30 "female" "no college"     "married"  909106        0  14145        0  23369.2 2052 1991 41 "male"   "no college"     "single"   555488 167927.4 132860 138073.7 101266.5 2704 1991 38 "female" "no college"     "married"  684027        0 126889        0  17526.9 3717 1991 64 "female" "no college"     "married"  648462        0  50486        0  7789.73 6103 1991 23 "male"   "some college"   "married"  152197  37317.2  23562 24256.18 42843.53 2817 1991 38 "male"   "college degree" "married"  708506 167927.4 116864 138073.7    58423 7448 1991 20 "female" "some college"   "single"   730869        0  13604        0  3894.87 9100 1991 69 "male"   "no college"     "single"   913466 177256.7  96447 22390.32 50633.27 2149 1991 89 "female" "no college"     "married"  197687        0  94439        0  1947.43 7246 1991 31 "male"   "no college"     "single"   496424        0  95240        0 19474.33 8313 1991 47 "female" "no college"     "single"   434513        0  12686        0  11684.6 2949 1991 27 "male"   "no college"     "other"    546024 14926.88  89873   932.93 21421.77 8643 1991 62 "male"   "no college"     "single"   896026 42914.78 104588        0        0 9274 1991 59 "female" "no college"     "married"  479000        0  64410        0   5842.3 4456 1991 71 "male"   "no college"     "married"  602986  3731.72 150917        0  11684.6 2847 1991 77 "male"   "no college"     "single"   277974 354513.4 103608  46646.5 33106.37 7329 1991 68 "male"   "no college"     "single"   763591 166061.5  85427        0  29211.5 1730 1991 62 "male"   "no college"     "single"   209234 167927.4  68653        0  46738.4 6230 1991 75 "male"   "no college"     "married"  890709   186586 148651        0  35053.8 7923 1991 41 "female" "no college"     "married"  771370        0  39279        0  1246.36 3900 1991 41 "male"   "no college"     "married"  575715        0 111913        0  11684.6 4593 1991 49 "male"   "no college"     "other"    814447  7463.44  20921        0  23369.2 2908 1991 57 "male"   "no college"     "other"    539851 139939.5  75421        0 42843.53 5323 1991 55 "female" "no college"     "married"  315127        0  17008        0  23369.2 1150 1991 22 "female" "no college"     "married"  245957        0 167394        0 15579.47 1101 1991 25 "male"   "some college"   "single"   875079        0 110549        0 27264.07 2944 1991 55 "male"   "no college"     "single"   935148        0 101971        0 79844.77 6772 1991 36 "male"   "some college"   "single"   555900  27987.9 129690 22390.32  46738.4 4534 1991 34 "female" "some college"   "married"  290781        0  77020        0   5842.3 8092 1991 65 "female" "no college"     "single"   738660  83963.7  36085 13061.02 37001.23 6894 1991 79 "male"   "no college"     "single"   656805   106354  86434 61573.38 25316.63 9977 1991 33 "female" "some college"   "single"   193182 63439.24 141840 63439.24 27264.07 1768 1991 28 "female" "no college"     "married"  666021        0  91229        0 15579.47 1824 1991 64 "male"   "no college"     "married"  541672        0 118433        0   5842.3 3643 1991 89 "male"   "some college"   "single"   818732   373172 137602        0  1071088 4997 1991 25 "female" "no college"     "married"  468437        0 165828        0  1947.43 4132 1991 60 "male"   "college degree" "single"   368213 149268.8  62349 26122.04 50633.27 5300 1991 73 "male"   "no college"     "single"   679315  83963.7  84850        0 66212.73 1170 1991 26 "female" "no college"     "married"   14879        0  80432        0   5842.3 2563 1991 48 "female" "no college"     "single"   429400        0  16176        0  1947.43 4063 1991 65 "female" "no college"     "single"   629704 126878.5  99150        0 21421.77 6872 1991 71 "male"   "no college"     "single"    76852        0  70775        0 72055.03 4436 1991 62 "female" "no college"     "married"  316970        0  77770        0  9737.17 4185 1991 36 "male"   "no college"     "single"   202205        0  76062        0 19474.33 4067 1991 25 "male"   "no college"     "single"   475830 42914.78  27564        0 38948.67 8367 1991 69 "male"   "no college"     "single"   261998    93293  16604        0  17526.9 7968 1991 63 "female" "no college"     "single"   268725        0  53120        0  7789.73 3998 1991 62 "male"   "college degree" "single"   740541 139939.5  11714        0 142162.6 1347 1991 59 "male"   "college degree" "single"   595995 158598.1 128907        0 83739.63 4742 1991 22 "female" "no college"     "other"    442012        0 134844        0 72055.03 3240 1991 62 "male"   "no college"     "single"   570063        0  50580        0   5842.3 5142 1991 34 "male"   "no college"     "divorced"  58672 41048.92  15796 33585.48 68160.17 8874 1991 54 "male"   "no college"     "single"   494273        0 168666        0 15579.47 7177 1991 68 "female" "no college"     "married"  424800 61573.38  32789        0 13632.03 3698 1991 71 "male"   "no college"     "single"   135047  55975.8  85224        0 21421.77 4389 1991 32 "female" "some college"   "married"   12864  37317.2  45873        0 15579.47 6858 1991 35 "female" "no college"     "single"   848145  37317.2  19989 24256.18  11684.6 2173 1991 80 "female" "no college"     "married"  289345        0  77086        0  9737.17 2428 1991 37 "male"   "no college"     "single"   311670    93293 145319  5597.58 25316.63 9148 1991 40 "male"   "some college"   "single"   546876        0  60957        0 37001.23 4338 1991 30 "male"   "some college"   "single"   366751  55975.8  38301 24256.18  46738.4 8998 1991 68 "male"   "no college"     "single"   888665 50378.22  16839        0  23369.2 5416 1991 75 "male"   "no college"     "single"   375649 261220.4  33667        0 48685.83 7048 1991 54 "male"   "some college"   "single"   505780 326525.5  97236        0 72055.03 7301 1991 67 "male"   "no college"     "single"   751425 261220.4  71724        0 31158.93 5946 1991 52 "male"   "no college"     "single"   701047  37317.2 156030 13061.02 74002.47 8279 1991 46 "male"   "no college"     "single"   736259 13061.02  14845        0  9737.17 4718 1991 47 "male"   "some college"   "single"    19166 121280.9 165994 179122.6 194743.3 6625 1991 42 "male"   "no college"     "single"   401005  74634.4  35055 67170.96  46738.4 3652 1991 32 "male"   "no college"     "single"   950758  3731.72 120750        0 38948.67 2717 1991 70 "male"   "no college"     "single"   900858  37317.2 121874        0 21421.77 end