Hello Statalisters,
I'm having a problem with creating horizontal bar graphs and need some assistance. We have a dataset with both zipcodes and census tracts and used the Housing and Urban Development crosswalk file to allow for data to be added from other sources. What this means is that we have zip codes with multiple census tracts (these aren't synonymous in terms of geography but some of our datasources only used census tracts while others used zip codes). Anyway, now I want to create bar graphs that show patterns of evictions and foreclosures but do to the shape of the data when I call the command, the y-axis is crowded. Here's an example of the data:
and here is an example of what an hbar chart looks like with that data:

Clearly this is a bit nonsensical and I'm wondering if I need to somehow collapse the data prior to creating these graphs, but hesitate to do so as this changes the overall shape of the data. Any ideas?
I'm having a problem with creating horizontal bar graphs and need some assistance. We have a dataset with both zipcodes and census tracts and used the Housing and Urban Development crosswalk file to allow for data to be added from other sources. What this means is that we have zip codes with multiple census tracts (these aren't synonymous in terms of geography but some of our datasources only used census tracts while others used zip codes). Anyway, now I want to create bar graphs that show patterns of evictions and foreclosures but do to the shape of the data when I call the command, the y-axis is crowded. Here's an example of the data:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long zip str19 censustractname int(evictfilings_2020 evictfilings_2021 evictfilings_2022) byte(foreclosurenote_2020 foreclosurenote_2021) 37501 "Census Tract 219" 65 79 119 0 0 38101 "Census Tract 43" 21 32 67 0 0 38103 "Census Tract 1" 23 49 83 14 22 38103 "Census Tract 113" 32 22 39 14 22 38103 "Census Tract 114" 155 177 280 14 22 38103 "Census Tract 37" 41 71 58 14 22 38103 "Census Tract 38" 40 68 50 14 22 38103 "Census Tract 39" 84 110 109 14 22 38103 "Census Tract 42" 86 124 202 14 22 38103 "Census Tract 43" 21 32 67 14 22 38104 "Census Tract 115" 43 51 66 6 10 38104 "Census Tract 16" 1 7 8 6 10 38104 "Census Tract 17" 31 33 32 6 10 38104 "Census Tract 25" 45 48 80 6 10 38104 "Census Tract 26" 7 6 10 6 10 38104 "Census Tract 31" 16 23 23 6 10 38104 "Census Tract 32" 69 73 111 6 10 38104 "Census Tract 33" 1 8 10 6 10 38104 "Census Tract 34" 50 64 81 6 10 38104 "Census Tract 35" 43 31 57 6 10 38104 "Census Tract 36" 44 72 83 6 10 38104 "Census Tract 37" 41 71 58 6 10 38104 "Census Tract 38" 40 68 50 6 10 38104 "Census Tract 46" 31 34 53 6 10 38104 "Census Tract 62" 25 30 35 6 10 38104 "Census Tract 63" 19 15 19 6 10 38104 "Census Tract 66" 18 14 19 6 10 38105 "Census Tract 113" 32 22 39 22 22 38105 "Census Tract 20" 41 48 52 22 22 38105 "Census Tract 21" 33 33 74 22 22 38105 "Census Tract 24" 66 59 74 22 22 38105 "Census Tract 25" 45 48 80 22 22 38105 "Census Tract 36" 44 72 83 22 22 38105 "Census Tract 38" 40 68 50 22 22 38105 "Census Tract 39" 84 110 109 22 22 38105 "Census Tract 42" 86 124 202 22 22 38106 "Census Tract 115" 43 51 66 0 0 38106 "Census Tract 116" 50 29 53 0 0 38106 "Census Tract 117" 24 17 28 0 0 38106 "Census Tract 225.00" 129 121 310 0 0 38106 "Census Tract 43" 21 32 67 0 0 38106 "Census Tract 50" 48 16 28 0 0 38106 "Census Tract 55" 75 61 72 0 0 38106 "Census Tract 56" 122 128 280 0 0 38106 "Census Tract 57" 37 30 48 0 0 38106 "Census Tract 58" 26 28 41 0 0 38106 "Census Tract 59" 55 41 61 0 0 38106 "Census Tract 60" 33 26 37 0 0 38106 "Census Tract 62" 25 30 35 0 0 38106 "Census Tract 64" 27 26 39 0 0 end
Clearly this is a bit nonsensical and I'm wondering if I need to somehow collapse the data prior to creating these graphs, but hesitate to do so as this changes the overall shape of the data. Any ideas?
Comment