ANÁLISIS ESTADÍSTICO

CARGA DE DATOS Y LIBRERÍAS

# Carga tus datos aquí (ajusta según tu formato):
base_datos <- read.csv("C:\\Users\\vlady\\Documents\\debers alexa no borrar\\Mining_model_input_data.csv")

TABLAS DE DISTRIBUCIÓN FIPS

Tabla 8: Frecuencia absoluta

col_fips   <- base_datos$FIPS_STATE_CNTY
valid_fips <- !is.na(col_fips) & as.character(col_fips) != ""
cat_fips   <- as.character(col_fips[valid_fips])

tabla_var8_df <- aggregate(
  list(ni = cat_fips),
  by = list(Variable = cat_fips),
  FUN = length
)
tabla_var8_df <- tabla_var8_df[order(-tabla_var8_df$ni), ]

gt(tabla_var8_df) |>
  tab_header(
    title = "Tabla N° 8",
    subtitle = "Distribución de Frecuencia Absoluta del Código FIPS"
  ) |>
  cols_label(
    Variable = "Código FIPS",
    ni = "Frecuencia absoluta (ni)"
  ) |>
  grand_summary_rows(
    columns = ni,
    fns = list(Total = ~sum(., na.rm = TRUE)),
    fmt = ~fmt_number(., decimals = 0)
  )
Tabla N° 8
Distribución de Frecuencia Absoluta del Código FIPS
Código FIPS Frecuencia absoluta (ni)
8123 2679
42115 2155
42107 1968
4013 1620
48329 1562
27137 1539
35015 1309
54047 1260
6071 1224
35025 1194
48389 1182
42111 1128
50021 1128
55025 1122
21195 1113
42015 1112
4025 1080
48317 1046
32007 1041
42033 1020
32003 1008
51027 990
38053 976
48227 964
6065 960
55063 945
23005 936
40061 909
51195 890
48491 876
48255 869
4021 852
23031 834
56025 804
49015 795
33013 774
54059 756
2090 753
55027 747
30029 744
55133 744
55073 738
49035 723
25027 720
48141 720
54081 720
48301 715
42097 696
25023 690
6029 685
27145 684
54039 684
42079 681
56009 663
4015 660
40079 658
36089 648
8077 642
41017 633
48461 617
48029 612
1073 602
53033 600
32013 591
54045 591
23019 585
27041 582
38105 578
8043 578
16001 564
50015 564
6037 564
55005 561
55039 558
49049 555
29161 552
47035 549
36007 546
42081 539
48283 537
19045 516
36045 516
48495 516
56005 513
36031 510
2170 507
38061 507
27037 504
4019 504
6073 504
16027 501
36115 498
50027 498
33011 495
1127 492
32023 492
42021 492
54025 492
49047 490
51051 488
42005 487
8045 487
8069 485
53061 483
48149 479
6023 477
48173 476
36083 474
40073 472
2020 471
49045 471
38025 469
23009 468
32019 468
36009 468
42127 468
42131 463
48479 463
38089 462
54109 459
36065 456
36101 456
41029 456
49003 456
49053 447
9005 447
1117 444
23003 444
30089 444
33009 444
15001 441
8093 441
21095 435
41039 432
50025 432
55071 432
36019 429
56037 423
48475 416
48383 413
27053 411
13319 408
21013 408
25003 408
25017 408
36025 408
36075 408
55135 408
13303 405
27111 399
55111 399
9003 399
42051 398
48399 397
4005 396
4007 396
48253 396
53053 396
56003 396
27009 393
41011 393
55105 393
9011 390
21071 387
27109 387
33015 387
9015 387
48135 386
2122 384
23013 384
26081 384
26103 384
4003 384
42063 384
44007 384
55009 384
39117 381
19191 378
48109 378
48201 375
17099 372
26125 372
35019 372
37111 372
48123 371
48371 370
36111 369
48177 369
6089 369
27171 366
42125 364
36027 360
48411 360
48453 360
25005 357
50023 354
26075 351
47115 351
12105 348
25013 348
36069 348
47007 348
48091 348
23011 345
42117 345
49013 345
42059 344
27013 342
55017 342
56021 337
26005 336
29099 336
34037 336
42017 336
42049 336
42071 336
56035 335
2240 330
36001 330
39157 330
55095 330
22117 327
55081 327
21133 324
26087 324
39013 324
42027 324
42069 324
54019 324
19001 321
34029 321
50017 321
42019 319
53009 318
41043 315
55087 315
42073 313
16017 312
16031 312
23007 312
26037 312
29189 312
30053 312
36091 312
4017 312
41005 312
42089 312
45063 312
53041 312
54067 309
48003 307
48325 303
17197 300
26067 300
26143 300
29113 300
36109 300
41019 300
41047 300
44009 300
6077 300
9009 300
48215 299
8081 298
2180 297
23001 297
30031 297
48293 293
27007 291
36061 291
51167 291
49041 289
18105 288
30083 288
42011 288
53063 288
6045 288
6083 288
30049 282
40017 282
46099 282
48013 282
53073 282
48375 279
40011 278
40051 277
42129 277
12086 276
17201 276
22105 276
2290 276
32031 276
32033 276
36043 276
36103 276
42095 276
49021 276
6007 276
9013 276
25015 273
51029 273
35045 272
48497 272
46103 270
17141 264
24023 264
26093 264
36013 264
36067 264
40143 264
47093 264
48463 264
5119 264
6079 264
8049 264
48127 263
22031 261
55131 261
8107 261
30057 258
36113 258
42091 258
46051 258
53035 258
53067 258
1125 256
40069 256
27027 255
30045 255
37121 255
54005 255
48291 253
13221 252
16019 252
17111 252
20173 252
26045 252
29186 252
36021 252
36077 252
41059 252
47143 252
48053 252
49007 252
51185 252
6027 252
8101 252
35039 250
21121 249
36017 249
49039 249
8041 249
23027 246
31019 243
35013 243
46019 243
12015 240
18093 240
18109 240
20197 240
22051 240
26139 240
27097 240
30111 240
32015 240
36071 240
36107 240
37159 240
39151 240
47141 240
48027 240
49023 240
53057 240
55115 240
6005 240
6025 240
8059 240
54061 239
20105 237
35057 237
41015 237
53007 237
19187 231
21235 231
27061 231
29179 231
33007 231
55085 231
8067 230
48363 229
13105 228
16079 228
18057 228
21193 228
23017 228
27005 228
32027 228
33019 228
34011 228
41051 228
41057 228
48221 228
49027 228
50001 228
55093 228
56011 228
56013 228
48311 226
27093 225
55019 225
16049 222
20087 222
25001 222
35055 222
54051 222
48251 221
27057 219
27147 219
28109 219
16029 216
16055 216
16069 216
17089 216
18133 216
19113 216
21139 216
26117 216
29095 216
29187 216
30013 216
30063 216
35049 216
35061 216
39061 216
39075 216
39133 216
41071 216
42029 216
42065 216
48139 216
48339 216
48297 214
20091 213
26025 213
29213 213
35009 213
36117 213
39067 213
53025 213
55061 213
6069 213
27035 210
35005 210
55121 210
6115 210
26033 207
33005 207
12083 204
27055 204
29027 204
32011 204
35001 204
36003 204
39173 204
41001 204
45003 204
5051 204
5143 204
55047 204
6107 204
19049 201
29093 201
6093 201
24001 198
36035 198
55015 198
55097 198
8051 198
40121 197
27079 195
33001 195
48355 193
1115 192
17105 192
18083 192
18151 192
19167 192
22091 192
23025 192
25021 192
26077 192
27067 192
27083 192
27119 192
30047 192
32029 192
36029 192
37183 192
40115 192
41013 192
42041 192
42121 192
45025 192
48171 192
53015 192
53029 192
53077 192
55067 192
56033 192
6063 192
6111 192
8083 192
8085 192
35043 191
20117 189
26155 189
26161 189
29131 189
40109 189
53045 189
55119 189
53065 186
55043 186
48103 185
27127 183
31041 183
33003 183
37119 183
55029 183
55075 183
48203 181
49037 181
18051 180
27019 180
27021 180
27089 180
35059 180
36049 180
38101 180
39113 180
4009 180
47037 180
50019 180
51105 180
5131 180
55101 180
6049 180
6053 180
48097 179
26015 177
26059 177
26151 177
27139 177
53027 177
23021 174
27141 174
53011 174
48439 173
48451 172
56019 172
8103 172
36095 171
48367 169
8001 169
1071 168
12069 168
17031 168
18097 168
19153 168
2110 168
22063 168
24003 168
26055 168
26073 168
26157 168
27131 168
29031 168
29097 168
30081 168
32001 168
36037 168
4027 168
41067 168
42039 168
42133 168
46081 168
46085 168
47025 168
48309 168
48365 168
49043 168
50011 168
5063 168
5145 168
54083 168
56029 168
6033 168
8029 168
8071 166
19127 165
23015 165
27065 165
29073 165
37037 165
41033 165
41037 165
55083 165
55107 165
1097 162
19013 162
21119 162
38035 162
50003 162
50005 162
53039 162
20035 159
27117 159
31095 159
39017 159
12053 156
16059 156
19163 156
26029 156
26115 156
28029 156
29141 156
30041 156
32009 156
36015 156
36023 156
38049 156
39031 156
39057 156
4001 156
19043 153
19103 153
26061 153
35017 153
55109 153
16013 150
18113 150
20057 150
21131 150
48353 150
53037 150
53047 150
54095 150
55035 150
19083 147
48337 147
8015 147
48307 146
20155 145
22037 145
1001 144
12017 144
12121 144
13245 144
15009 144
17069 144
17103 144
18019 144
18033 144
18085 144
18145 144
19037 144
21015 144
22103 144
24015 144
26021 144
26153 144
31089 144
31141 144
31153 144
34041 144
36105 144
37045 144
37081 144
37125 144
38009 144
39079 144
39083 144
39123 144
39175 144
4012 144
40135 144
4023 144
45055 144
48259 144
48425 144
51069 144
6001 144
6009 144
6019 144
6097 144
6099 144
8013 144
8065 144
17085 141
18095 141
20055 141
20161 141
25011 141
31001 141
31079 141
45083 141
56031 141
48041 140
39059 139
15003 138
16005 138
17015 138
19057 138
30001 138
31047 138
41007 138
45035 138
46023 138
48341 137
56023 137
13227 135
17177 135
19179 135
37085 135
41035 135
46011 135
53005 135
48051 134
17161 132
18039 132
20001 132
2150 132
26043 132
30009 132
31157 132
34009 132
36039 132
39099 132
39147 132
40123 132
41009 132
41041 132
47005 132
48147 132
53021 132
55141 132
56043 132
6035 132
6067 132
39029 130
48501 130
16085 129
18003 129
19061 129
19097 129
26063 129
29165 129
31055 129
42037 129
49005 129
8105 129
12033 126
19007 126
20037 126
27163 126
29223 126
42057 126
16041 123
36093 123
36097 123
40043 122
40145 122
48331 121
1033 120
1101 120
1121 120
12001 120
12021 120
12063 120
12071 120
12119 120
13089 120
13163 120
16039 120
17023 120
17179 120
18061 120
18137 120
18153 120
18157 120
19055 120
20009 120
21111 120
24021 120
24043 120
25009 120
26071 120
27169 120
28095 120
29019 120
29047 120
29163 120
30003 120
36033 120
36051 120
36057 120
37105 120
38057 120
39049 120
39073 120
39089 120
39109 120
39111 120
39141 120
40023 120
40139 120
41025 120
42031 120
45051 120
46047 120
47029 120
47051 120
47183 120
48265 120
50007 120
5047 120
5059 120
51015 120
51047 120
51107 120
51183 120
53031 120
53055 120
55053 120
55069 120
55099 120
6013 120
6017 120
8087 120
16011 117
19065 117
19161 117
20177 117
23029 117
27085 117
36053 117
39145 117
40071 117
48401 117
49025 117
6057 117
8119 117
39081 116
48427 116
40101 115
48235 115
17195 114
19059 114
26007 114
30037 114
37025 114
38099 114
41049 114
46079 114
47157 114
47173 114
19041 111
26097 111
27121 111
37171 111
41045 111
42061 111
53017 111
6103 111
40077 110
1009 108
1089 108
17001 108
17165 108
18025 108
20051 108
21043 108
23023 108
26057 108
29077 108
30039 108
32510 108
35047 108
37101 108
39043 108
40035 108
40075 108
4011 108
42043 108
42055 108
47013 108
47149 108
48021 108
48133 108
48299 108
48465 108
50009 108
5029 108
51001 108
51031 108
54097 108
55125 108
55127 108
56015 108
6047 108
6059 108
6113 108
48163 107
20093 106
48121 106
16065 105
16067 105
26041 105
26047 105
26091 105
27015 105
31107 105
38073 105
41053 105
46033 105
54069 105
55033 105
55049 105
39019 104
13195 102
17007 102
21183 102
27151 102
49051 102
49055 102
40019 101
19027 99
20075 99
29009 99
38015 99
42009 99
22079 97
48025 97
48229 97
48237 97
48323 97
10001 96
1047 96
1049 96
1053 96
1059 96
1103 96
1113 96
12039 96
12107 96
12111 96
13073 96
13223 96
13269 96
16037 96
16077 96
17063 96
17119 96
17163 96
18089 96
18167 96
19005 96
19105 96
19143 96
20015 96
20059 96
20107 96
20209 96
21029 96
21059 96
21151 96
21163 96
21177 96
22003 96
26099 96
26119 96
26163 96
27017 96
27031 96
27101 96
27135 96
28035 96
28107 96
29071 96
29157 96
30043 96
32005 96
34035 96
35011 96
35053 96
36055 96
36073 96
37021 96
37089 96
37153 96
37189 96
37193 96
38011 96
39071 96
39119 96
39129 96
39131 96
40099 96
42001 96
42013 96
42077 96
42085 96
42103 96
42123 96
45021 96
45079 96
46013 96
46135 96
47065 96
47089 96
47113 96
47133 96
48035 96
48043 96
48145 96
48233 96
48257 96
48267 96
48333 96
48349 96
48441 96
5005 96
5007 96
5053 96
5065 96
5083 96
51075 96
51175 96
51800 96
53049 96
54003 96
55137 96
56001 96
56045 96
6021 96
6087 96
6109 96
8021 96
9001 96
13317 93
16045 93
19131 93
2063 93
26009 93
27023 93
27173 93
35029 93
35051 93
38017 93
41003 93
47163 93
5097 93
53051 93
56017 93
48493 91
16075 90
16087 90
17149 90
17157 90
18125 90
19033 90
2068 90
26035 90
27047 90
31121 90
37051 90
37129 90
40085 90
41065 90
46089 90
48417 89
42007 88
26089 87
27133 87
30095 87
37123 87
47057 87
47071 87
51165 87
55023 87
55117 87
56007 87
22017 86
42003 85
10005 84
1005 84
1093 84
1099 84
12009 84
12131 84
17143 84
18053 84
18173 84
20011 84
21127 84
21199 84
22089 84
26031 84
26053 84
27045 84
27103 84
28087 84
29013 84
29139 84
29183 84
30007 84
30027 84
33017 84
38093 84
39127 84
39165 84
39167 84
40089 84
41031 84
45029 84
46025 84
47153 84
48089 84
48099 84
48281 84
54055 84
8099 84
9007 84
40093 83
48165 82
13103 81
16043 81
17145 81
21099 81
26147 81
28047 81
29015 81
36011 81
40049 81
40087 81
40091 80
21115 78
27025 78
27115 78
29145 78
37133 78
38069 78
38077 78
38103 78
40131 78
45067 78
47049 78
48503 78
6043 78
8089 78
22015 77
48113 77
48405 77
54049 77
30085 76
39121 76
48415 76
24033 75
27153 75
36121 75
36123 75
40113 75
40133 75
51023 75
8113 75
30087 74
22011 73
48015 73
48131 73
48213 73
1003 72
1051 72
1057 72
1079 72
1083 72
1085 72
1095 72
1111 72
12043 72
12057 72
12099 72
12101 72
12113 72
12123 72
13015 72
13057 72
13087 72
13091 72
13097 72
13141 72
13261 72
17091 72
17093 72
17101 72
17113 72
17123 72
17135 72
17151 72
18005 72
18017 72
18047 72
18055 72
18067 72
18081 72
18087 72
18103 72
18177 72
18179 72
19125 72
19139 72
19155 72
19177 72
20003 72
20133 72
21053 72
21083 72
21093 72
2188 72
22033 72
22045 72
24005 72
24035 72
26049 72
26127 72
27011 72
27075 72
27113 72
27159 72
28091 72
28139 72
29003 72
29029 72
29045 72
29051 72
29053 72
29055 72
29091 72
29101 72
29173 72
29177 72
29215 72
30107 72
31039 72
31053 72
31155 72
32017 72
32021 72
34005 72
34007 72
34015 72
34019 72
34027 72
35006 72
35035 72
36087 72
37007 72
37027 72
37035 72
37049 72
37067 72
37069 72
37107 72
38037 72
39003 72
39009 72
39037 72
39085 72
39095 72
39105 72
39159 72
40013 72
40021 72
40055 72
42025 72
42045 72
42075 72
42109 72
45007 72
45059 72
45087 72
47003 72
47015 72
47107 72
47117 72
47123 72
47147 72
47159 72
47185 72
47189 72
48049 72
48069 72
48207 72
48209 72
48217 72
48285 72
48303 72
48381 72
48403 72
49029 72
5045 72
5075 72
5091 72
51095 72
51101 72
5113 72
5115 72
51187 72
51197 72
5135 72
5137 72
54077 72
55013 72
55031 72
6081 72
6085 72
6095 72
6105 72
8019 72
8035 72
8055 72
13157 69
19025 69
19063 69
19115 69
20017 69
20043 69
20047 69
26069 69
27049 69
29063 69
30023 69
31093 69
37009 69
39011 69
46043 69
46093 69
47091 69
55011 69
55089 69
6051 69
8025 69
8027 69
40137 68
13123 66
17037 66
18117 66
19195 66
26019 66
27105 66
30093 66
31049 66
31111 66
46125 66
47155 66
48169 66
55041 66
8091 66
48181 65
40015 64
40045 64
17183 63
18165 63
19111 63
20139 63
21175 63
26027 63
26141 63
27071 63
41061 63
46009 63
48179 63
49011 63
55139 63
56041 63
40151 62
8007 62
40063 61
40119 61
48205 61
10003 60
1015 60
1025 60
1055 60
1087 60
12061 60
13117 60
17067 60
17167 60
17187 60
18031 60
18035 60
19169 60
2066 60
21051 60
2220 60
26011 60
26065 60
26113 60
27073 60
27143 60
29061 60
29119 60
29153 60
29203 60
31037 60
36063 60
37065 60
37161 60
37167 60
39023 60
42087 60
45075 60
46015 60
46059 60
47187 60
48037 60
48151 60
48153 60
48305 60
48359 60
49031 60
5015 60
51036 60
53059 60
54093 60
54099 60
56039 60
6061 60
8009 60
22081 59
48033 59
48115 59
40147 58
42083 58
42113 58
20181 57
21089 57
27157 57
31025 57
38003 57
38019 57
42047 56
42105 56
1007 54
21025 54
21153 54
2198 54
26165 54
30075 54
30097 54
31101 54
35041 54
46065 54
46091 54
46109 54
48077 54
55021 54
48219 52
15007 51
26109 51
27033 51
37195 51
40065 51
51033 51
53043 51
54057 51
40005 50
40007 50
48409 50
20151 49
22115 49
40027 49
48335 49
1039 48
1061 48
1081 48
1091 48
12019 48
12045 48
12051 48
12067 48
12075 48
13063 48
13113 48
13121 48
13129 48
13133 48
13135 48
13139 48
13165 48
13169 48
13189 48
13207 48
13211 48
13213 48
13215 48
13217 48
13233 48
13263 48
13289 48
13301 48
16009 48
16071 48
16073 48
17019 48
17029 48
17035 48
17051 48
17055 48
17057 48
17077 48
17083 48
17087 48
17097 48
17181 48
17193 48
18001 48
18015 48
18021 48
18027 48
18037 48
18071 48
18075 48
18091 48
18099 48
18121 48
18129 48
18131 48
18163 48
18169 48
18171 48
18181 48
19099 48
19107 48
19151 48
20005 48
20007 48
20049 48
20061 48
20073 48
20085 48
20111 48
20149 48
20205 48
21001 48
21019 48
21027 48
21033 48
21055 48
21067 48
21091 48
21179 48
21203 48
21227 48
2130 48
22013 48
22019 48
22101 48
24013 48
24025 48
24027 48
26023 48
26039 48
26107 48
26129 48
26133 48
26149 48
27001 48
27039 48
27077 48
27087 48
27125 48
28001 48
28033 48
28085 48
28119 48
28163 48
29023 48
29035 48
29037 48
29067 48
29075 48
29081 48
29195 48
29201 48
29207 48
29219 48
29221 48
29225 48
30017 48
30021 48
30073 48
30091 48
30101 48
31003 48
31035 48
31057 48
31067 48
31087 48
31119 48
34001 48
34031 48
35027 48
35031 48
37001 48
37023 48
37053 48
37057 48
37059 48
37087 48
37093 48
37097 48
37109 48
37113 48
37141 48
37147 48
37157 48
37175 48
37181 48
37191 48
38005 48
38027 48
38039 48
38045 48
38065 48
38075 48
39015 48
39021 48
39027 48
39033 48
39035 48
39091 48
39101 48
39125 48
39135 48
39139 48
39143 48
39149 48
39161 48
39169 48
40105 48
41055 48
41063 48
42119 48
44003 48
44005 48
45037 48
45039 48
45041 48
45045 48
45057 48
45091 48
46063 48
46119 48
47009 48
47019 48
47041 48
47043 48
47055 48
47059 48
47073 48
47079 48
47105 48
47109 48
47119 48
47125 48
47145 48
47165 48
48019 48
48031 48
48093 48
48117 48
48129 48
48187 48
48437 48
48449 48
48467 48
48469 48
49001 48
49019 48
49057 48
5033 48
5071 48
5081 48
51019 48
5103 48
51035 48
51041 48
51061 48
51077 48
51085 48
5109 48
51093 48
51097 48
5111 48
51121 48
51147 48
51171 48
51177 48
51191 48
5141 48
51550 48
54023 48
54085 48
55059 48
55079 48
55123 48
55129 48
6039 48
6041 48
8117 48
54033 46
13115 45
19087 45
19121 45
20053 45
21159 45
21233 45
24037 45
26051 45
26123 45
27095 45
27129 45
31023 45
39093 45
42067 45
47103 45
47175 45
49017 45
51003 45
51083 45
53075 45
54103 45
55065 45
8003 45
8063 45
1133 42
17173 42
19197 42
22085 42
22121 42
27003 42
36099 42
38071 42
40003 42
46017 42
48499 42
51009 42
54101 42
42035 41
48507 40
13137 39
16057 39
16081 39
20029 39
20127 39
22005 39
26013 39
37199 39
40001 39
46087 39
48395 39
8057 39
48059 38
48477 38
22069 37
40039 37
48287 37
12005 36
12029 36
13173 36
13281 36
13305 36
16051 36
17027 36
17185 36
18101 36
18127 36
19067 36
2016 36
21161 36
22075 36
24011 36
27081 36
27149 36
28023 36
28049 36
29043 36
29085 36
29137 36
29229 36
30025 36
31125 36
31137 36
31177 36
34025 36
35007 36
36079 36
37061 36
38013 36
40095 36
41027 36
45077 36
46057 36
48155 36
49033 36
5009 36
5031 36
5037 36
5089 36
51059 36
51067 36
51143 36
53003 36
53069 36
8075 36
8109 36
40083 35
40081 34
48487 34
12133 33
16015 33
18143 33
19109 33
19193 33
21107 33
27069 33
29117 33
40047 33
40107 33
40117 33
40153 33
47135 33
48067 33
51163 33
5133 33
54007 33
54009 33
55055 33
40149 31
48423 31
16007 30
16021 30
19029 30
19101 30
19137 30
40037 30
40125 30
41021 30
48161 30
50013 30
55051 30
8014 30
8053 30
48483 29
40111 28
48183 28
54017 28
16083 27
18147 27
19119 27
20081 27
20129 27
20193 27
22093 27
27165 27
30015 27
30059 27
37155 27
38043 27
40097 27
47179 27
48073 27
48429 27
22119 26
31105 26
48197 26
48431 26
48485 26
40031 25
40059 25
1019 24
1021 24
1035 24
1065 24
1075 24
1119 24
1123 24
1129 24
12007 24
12011 24
12031 24
12041 24
12047 24
12049 24
12073 24
12081 24
12085 24
12095 24
13013 24
13019 24
13021 24
13025 24
13037 24
13045 24
13047 24
13049 24
13055 24
13059 24
13067 24
13075 24
13077 24
13079 24
13095 24
13101 24
13111 24
13127 24
13147 24
13151 24
13153 24
13175 24
13179 24
13183 24
13187 24
13209 24
13225 24
13229 24
13241 24
13255 24
13257 24
13275 24
13285 24
13291 24
13297 24
13311 24
13313 24
16003 24
16033 24
16047 24
16053 24
16061 24
17003 24
17005 24
17011 24
17021 24
17033 24
17041 24
17053 24
17065 24
17073 24
17075 24
17081 24
17109 24
17115 24
17125 24
17127 24
17129 24
17133 24
17153 24
17155 24
17171 24
17189 24
17199 24
17203 24
18009 24
18011 24
18013 24
18029 24
18041 24
18043 24
18045 24
18049 24
18065 24
18069 24
18079 24
18107 24
18111 24
18135 24
18139 24
18155 24
19011 24
19019 24
19021 24
19035 24
19047 24
19073 24
19091 24
19149 24
19157 24
19185 24
20019 24
20025 24
20027 24
20069 24
20079 24
20095 24
20097 24
20099 24
20113 24
20115 24
20121 24
20131 24
20147 24
20157 24
20159 24
20165 24
20169 24
20185 24
20191 24
20201 24
21003 24
21005 24
21009 24
21017 24
21021 24
21031 24
21035 24
21039 24
21045 24
21047 24
21057 24
21065 24
21069 24
21073 24
21077 24
21079 24
21085 24
21087 24
21101 24
21103 24
21109 24
21113 24
21123 24
21125 24
21135 24
21141 24
21143 24
21145 24
21149 24
21155 24
21157 24
21165 24
21167 24
21171 24
21173 24
21185 24
21191 24
21197 24
21209 24
21213 24
21219 24
21221 24
21225 24
21231 24
2185 24
22009 24
22057 24
22067 24
22071 24
22073 24
22099 24
22113 24
22127 24
24017 24
24019 24
24029 24
24031 24
24045 24
25007 24
25025 24
26079 24
26105 24
26121 24
26131 24
26145 24
26159 24
27051 24
27167 24
28013 24
28015 24
28025 24
28037 24
28043 24
28045 24
28057 24
28071 24
28075 24
28093 24
28103 24
28111 24
28131 24
28137 24
28149 24
29011 24
29017 24
29021 24
29025 24
29049 24
29059 24
29065 24
29083 24
29089 24
29103 24
29105 24
29107 24
29109 24
29111 24
29123 24
29127 24
29135 24
29149 24
29151 24
29159 24
29169 24
29175 24
29181 24
29185 24
29205 24
29209 24
29510 24
30005 24
30019 24
30035 24
30051 24
30061 24
30065 24
30071 24
30077 24
30103 24
31015 24
31017 24
31061 24
31077 24
31129 24
31133 24
31139 24
31145 24
31159 24
31169 24
31175 24
34021 24
34023 24
34033 24
35033 24
35037 24
36041 24
36119 24
37005 24
37013 24
37015 24
37019 24
37029 24
37033 24
37039 24
37043 24
37047 24
37063 24
37071 24
37075 24
37077 24
37099 24
37115 24
37117 24
37127 24
37131 24
37135 24
37145 24
37149 24
37151 24
37163 24
37165 24
37169 24
37173 24
37179 24
37197 24
38041 24
38055 24
38059 24
38067 24
38087 24
38095 24
39001 24
39007 24
39025 24
39041 24
39045 24
39055 24
39063 24
39097 24
39103 24
39107 24
39171 24
40025 24
40033 24
41069 24
42023 24
42093 24
42099 24
44001 24
45001 24
45015 24
45047 24
45053 24
45069 24
45073 24
45085 24
46021 24
46029 24
46037 24
46041 24
46045 24
46049 24
46053 24
46077 24
46097 24
46101 24
46105 24
46107 24
46115 24
46121 24
46123 24
46127 24
47001 24
47011 24
47021 24
47031 24
47039 24
47045 24
47061 24
47063 24
47067 24
47069 24
47081 24
47087 24
47121 24
47129 24
47131 24
47137 24
47177 24
47181 24
48001 24
48017 24
48061 24
48063 24
48081 24
48083 24
48125 24
48143 24
48157 24
48159 24
48225 24
48249 24
48279 24
48351 24
48357 24
48361 24
48385 24
48473 24
5011 24
5013 24
5023 24
5049 24
5055 24
5061 24
5067 24
5073 24
5079 24
5085 24
51005 24
51007 24
51021 24
51025 24
51043 24
51045 24
51053 24
51063 24
51071 24
51073 24
51079 24
51081 24
51089 24
51091 24
51099 24
51103 24
51109 24
51117 24
51127 24
51135 24
51145 24
51149 24
51153 24
51155 24
51161 24
51169 24
51179 24
51193 24
5121 24
5127 24
5149 24
51650 24
51678 24
51730 24
51760 24
51770 24
51790 24
51810 24
53013 24
53019 24
54001 24
54031 24
54037 24
54041 24
54043 24
54053 24
54071 24
54075 24
54091 24
54105 24
54107 24
55001 24
55007 24
55091 24
55113 24
56027 24
6015 24
6055 24
6075 24
6101 24
8005 24
8011 24
8023 24
8031 24
8037 24
8039 24
8047 24
19079 21
20101 21
20183 21
22095 21
31027 21
31115 21
31143 21
39005 21
47167 21
55045 21
6091 21
8017 21
48195 20
48505 20
18073 18
19171 18
20021 18
26003 18
27099 18
27123 18
31071 18
38079 18
38083 18
38097 18
46055 18
47171 18
48243 18
6003 18
8033 18
38023 17
48347 17
40103 16
48211 16
16035 15
17059 15
17117 15
2100 15
27155 15
29217 15
30109 15
41023 15
48189 15
48421 15
48447 15
22061 13
40029 13
48269 13
12093 12
13083 12
13143 12
13279 12
19015 12
19089 12
20013 12
20041 12
20135 12
20189 12
21129 12
2158 12
2195 12
22059 12
2230 12
26083 12
27029 12
27043 12
27107 12
27161 12
29001 12
29167 12
31033 12
31045 12
37011 12
38021 12
39065 12
45019 12
46003 12
46067 12
46071 12
48167 12
48223 12
48271 12
48277 12
48419 12
48445 12
51037 12
53001 12
53071 12
22125 11
48107 11
48009 10
48261 10
1043 9
19023 9
20187 9
2070 9
22043 9
26101 9
28069 9
39087 9
46035 9
48295 9
5125 9
8097 9
8121 9
38007 8
48005 8
48079 8
48065 7
20083 6
30099 6
37003 6
38047 6
48313 6
54087 6
35021 5
40129 5
48289 5
48393 5
54073 5
28005 4
48459 4
12109 3
30105 3
38001 3
39163 3
40009 3
48105 3
48319 3
28067 2
48047 2
48263 2
48373 2
48433 2
48457 2
8073 2
1107 1
20119 1
22027 1
22077 1
22107 1
28031 1
28129 1
40057 1
40067 1
48007 1
48095 1
48185 1
48199 1
48241 1
48273 1
48275 1
48327 1
48377 1
48435 1
48481 1
8061 1
Total — 330,466

Tabla 9: Frecuencia absoluta ajustada

fips_5d     <- str_pad(cat_fips, width = 5, side = "left", pad = "0")
top15_fips  <- names(sort(table(fips_5d), decreasing = TRUE))[seq_len(min(15, length(unique(fips_5d))))]
cat_fips_15 <- ifelse(fips_5d %in% top15_fips, fips_5d, "Otros códigos FIPS")

tabla_var9_df <- aggregate(
  list(ni = cat_fips_15),
  by = list(Variable = cat_fips_15),
  FUN = length
)
tabla_var9_df <- tabla_var9_df[order(-tabla_var9_df$ni), ]

N <- sum(tabla_var9_df$ni)
tabla_var9_df$ni_ajustada <- round((tabla_var9_df$ni / N) * 1000, 2)

gt(tabla_var9_df) |>
  tab_header(
    title = "Tabla N° 9",
    subtitle = "Distribución de Frecuencia Absoluta Ajustada del Código FIPS (por 1,000)"
  ) |>
  cols_label(
    Variable = "Código FIPS",
    ni = "Frecuencia absoluta (ni)",
    ni_ajustada = "Frecuencia absoluta ajustada"
  ) |>
  grand_summary_rows(
    columns = c(ni, ni_ajustada),
    fns = list(Total = ~sum(., na.rm = TRUE))
  )
Tabla N° 9
Distribución de Frecuencia Absoluta Ajustada del Código FIPS (por 1,000)
Código FIPS Frecuencia absoluta (ni) Frecuencia absoluta ajustada
Otros códigos FIPS 308283 932.87
08123 2679 8.11
42115 2155 6.52
42107 1968 5.96
04013 1620 4.90
48329 1562 4.73
27137 1539 4.66
35015 1309 3.96
54047 1260 3.81
06071 1224 3.70
35025 1194 3.61
48389 1182 3.58
42111 1128 3.41
50021 1128 3.41
55025 1122 3.40
21195 1113 3.37
Total — 330466 1000

Tabla 10: Frecuencia relativa y porcentaje

tabla_var10_fips_df <- tabla_var9_df[, c("Variable", "ni")]
N_fips <- sum(tabla_var10_fips_df$ni)

tabla_var10_fips_df$hi <- round(tabla_var10_fips_df$ni / N_fips, 4)
tabla_var10_fips_df$porcentaje <- round(tabla_var10_fips_df$hi * 100, 2)

gt(tabla_var10_fips_df) |>
  tab_header(
    title = "Tabla N° 10",
    subtitle = "Distribución de Frecuencia Relativa del Código FIPS"
  ) |>
  cols_label(
    Variable = "Código FIPS",
    ni = "Frecuencia absoluta (ni)",
    hi = "Frecuencia relativa (hi)",
    porcentaje = "Porcentaje (%)"
  ) |>
  grand_summary_rows(
    columns = c(ni, hi, porcentaje),
    fns = list(Total = ~sum(., na.rm = TRUE))
  )
Tabla N° 10
Distribución de Frecuencia Relativa del Código FIPS
Código FIPS Frecuencia absoluta (ni) Frecuencia relativa (hi) Porcentaje (%)
Otros códigos FIPS 308283 0.9329 93.29
08123 2679 0.0081 0.81
42115 2155 0.0065 0.65
42107 1968 0.0060 0.60
04013 1620 0.0049 0.49
48329 1562 0.0047 0.47
27137 1539 0.0047 0.47
35015 1309 0.0040 0.40
54047 1260 0.0038 0.38
06071 1224 0.0037 0.37
35025 1194 0.0036 0.36
48389 1182 0.0036 0.36
42111 1128 0.0034 0.34
50021 1128 0.0034 0.34
55025 1122 0.0034 0.34
21195 1113 0.0034 0.34
Total — 330466 1.0001 100.01

GRÁFICOS FIPS

Barras: Frecuencia absoluta ajustada

ggplot(tabla_var9_df, aes(x = reorder(Variable, ni_ajustada), y = ni_ajustada)) +
  geom_col(fill = "darkorange") +
  geom_text(aes(label = ni_ajustada), hjust = -0.1, size = 3.5) +
  coord_flip() +
  expand_limits(y = max(tabla_var9_df$ni_ajustada) * 1.12) +
  labs(
    title = "Distribución Ajustada del Código FIPS (FIPS_STATE_CNTY)",
    x = "Código FIPS",
    y = "Frecuencia absoluta ajustada"
  ) +
  theme_minimal(base_size = 12)

Barras: Frecuencia relativa

ggplot(tabla_var10_fips_df, aes(x = reorder(Variable, hi), y = hi)) +
  geom_col(fill = "mediumpurple") +
  geom_text(
    aes(label = paste0(porcentaje, "%")),
    hjust = -0.1,
    size = 3.5
  ) +
  coord_flip() +
  expand_limits(y = max(tabla_var10_fips_df$hi) * 1.12) +
  labs(
    title = "Frecuencia Relativa del Código FIPS (FIPS_STATE_CNTY)",
    x = "Código FIPS",
    y = "Frecuencia relativa (hi)"
  ) +
  theme_minimal(base_size = 12)

Pastel: Porcentaje FIPS (Top 15 + Otros)

ggplot(tabla_var10_fips_df, aes(x = "", y = porcentaje, fill = Variable)) +
  geom_col(width = 1, color = "white") +
  coord_polar(theta = "y") +
  geom_text(
    aes(label = ifelse(porcentaje >= 3, paste0(porcentaje, "%"), "")),
    position = position_stack(vjust = 0.5),
    size = 3.5
  ) +
  labs(
    title = "Distribución Porcentual del Código FIPS (FIPS_STATE_CNTY)",
    fill = "Código FIPS"
  ) +
  theme_void(base_size = 12)

CLASIFICACIÓN INDUSTRIAL (PRIMARY_SIC)

Tabla 11: Distribución PRIMARY_SIC

col_sic   <- base_datos$PRIMARY_SIC
valid_sic <- !is.na(col_sic) & as.character(col_sic) != ""
sic_vals  <- as.character(col_sic[valid_sic])

tabla_sic_df <- aggregate(
  list(ni = sic_vals),
  by = list(Variable = sic_vals),
  FUN = length
)
tabla_sic_df <- tabla_sic_df[order(-tabla_sic_df$ni), ]
tabla_sic_df$hi_pct <- round((tabla_sic_df$ni / sum(tabla_sic_df$ni)) * 100, 2)

gt(tabla_sic_df) |>
  tab_header(
    title = "Tabla N° 11",
    subtitle = "Distribución de Clasificación Industrial (PRIMARY_SIC)"
  ) |>
  cols_label(
    Variable = "Sector Industrial (SIC)",
    ni = "ni",
    hi_pct = "hi (%)"
  ) |>
  grand_summary_rows(
    columns = c(ni, hi_pct),
    fns = list(Total = ~sum(., na.rm = TRUE)),
    fmt = ~fmt_number(., decimals = 0)
  )
Tabla N° 11
Distribución de Clasificación Industrial (PRIMARY_SIC)
Sector Industrial (SIC) ni hi (%)
Construction Sand and Gravel 139287 45.37
Crushed, Broken Limestone NEC 44841 14.61
Coal (Bituminous) 22866 7.45
Crushed, Broken Stone NEC 20292 6.61
Dimension Stone NEC 10059 3.28
Sand, Common 9021 2.94
Crushed, Broken Granite 7296 2.38
Sand, Industrial NEC 7158 2.33
Gold Ore 3879 1.26
Dimension Sandstone 3690 1.20
Crushed, Broken Sandstone 3528 1.15
Dimension Limestone 3369 1.10
Coal (Anthracite) 3087 1.01
Crushed, Broken Traprock 2529 0.82
Cement 2412 0.79
Common Clays NEC 2247 0.73
Lime 1602 0.52
Gypsum 1350 0.44
Clay, Ceramic, Refractory Mnls. 1242 0.40
Dimension Granite 1212 0.39
Dimension Slate 1119 0.36
Common Shale 1089 0.35
Kaolin and Ball Clay 864 0.28
Copper Ore NEC 744 0.24
Bentonite 732 0.24
Fire Clay 663 0.22
Iron Ore 663 0.22
Coal (Lignite) 621 0.20
Shell 564 0.18
Lead-Zinc Ore 528 0.17
Barite Barium Ore 510 0.17
Crushed, Broken Slate 480 0.16
Crushed, Broken Basalt 450 0.15
Misc. Nonmetallic Mnls. NEC 417 0.14
Salt 396 0.13
Crushed, Broken Marble 327 0.11
Gemstones 321 0.10
Pumice 318 0.10
Talc 309 0.10
Dimension Marble 294 0.10
Diatomaceous Earth (Diatomite) 288 0.09
Phosphate Rock 288 0.09
Perlite 258 0.08
Dimension Traprock 240 0.08
Silver Ore 234 0.08
Ground Silica 231 0.08
Crushed, Broken Quartzite 192 0.06
Mica 192 0.06
Zinc 168 0.05
Feldspar 150 0.05
Leonardite 144 0.05
Quartz, Crystal 123 0.04
Potash 120 0.04
Gilsonite 108 0.04
Wollastonite 108 0.04
Dimension Basalt 96 0.03
Quartz, Ground 96 0.03
Uranium Ore 96 0.03
Zeolites 93 0.03
Fluorspar 84 0.03
Misc. Metal Ore NEC 72 0.02
Molybdenum Ore 72 0.02
Rare Earths Ore 66 0.02
Chem. and Fertil. Mnls. NEC 48 0.02
Chromite Chromium Ore 48 0.02
Kyanite 48 0.02
Magnetite 48 0.02
Nickel Ore 48 0.02
Platinum Group Ore 48 0.02
Potassium Compounds 48 0.02
Titanium Ore 48 0.02
Trona 48 0.02
Vermiculite 48 0.02
Aluminum Ore-Bauxite 45 0.01
Dimension Quartzite 45 0.01
Oil Shale 36 0.01
Soapstone, Crushed Dimension 36 0.01
Pigment Minerals 30 0.01
Crushed, Broken Mica 27 0.01
Aplite 24 0.01
Beryl-Beryllium Ore 24 0.01
Boron Minerals 24 0.01
Cobalt Ore 24 0.01
Fullers Earth 24 0.01
Garnet 24 0.01
Graphite 24 0.01
Magnesite 24 0.01
Manganese Ore 24 0.01
Olivine 24 0.01
Potash, Soda, Borate Mnls. NEC 24 0.01
Pyrophyllite 24 0.01
Sapphire 24 0.01
Tungsten Ore 24 0.01
Turquoise 24 0.01
Vanadium Ore 24 0.01
Agate 12 0.00
Oil Sand 12 0.00
Emerald 6 0.00
Total — 307,008 100

Barras: SIC (Top 10 + Otros)

top_n  <- 10
graf10 <- head(tabla_sic_df[, c("Variable", "ni")], top_n)

if (nrow(tabla_sic_df) > top_n) {
  otros  <- data.frame(
    Variable = "Otros",
    ni = sum(tabla_sic_df$ni[-(1:top_n)])
  )
  graf10 <- rbind(graf10, otros)
}

graf10$hi_pct <- round(graf10$ni / sum(graf10$ni) * 100, 2)

ggplot(graf10, aes(x = reorder(Variable, ni), y = ni)) +
  geom_col(fill = "darkorange") +
  geom_text(aes(label = paste0(hi_pct, "%")), hjust = -0.1, size = 3.5) +
  coord_flip() +
  expand_limits(y = max(graf10$ni) * 1.12) +
  labs(
    title = "Distribución de Clasificación Industrial (PRIMARY_SIC)",
    x = "Sector Industrial (SIC)",
    y = "Frecuencia absoluta (ni)"
  ) +
  theme_minimal(base_size = 12)

Pastel: SIC (Top 10 + Otros)

ggplot(graf10, aes(x = "", y = hi_pct, fill = Variable)) +
  geom_col(width = 1, color = "white") +
  coord_polar(theta = "y") +
  geom_text(
    aes(label = ifelse(hi_pct >= 3, paste0(hi_pct, "%"), "")),
    position = position_stack(vjust = 0.5),
    size = 3.5
  ) +
  labs(
    title = "Distribución Porcentual de Clasificación Industrial (PRIMARY_SIC)",
    fill = "SIC"
  ) +
  theme_void(base_size = 12)

CONCLUSIÓN

Resumen de hallazgos

Los resultados muestran que la categoría «Otros códigos FIPS» presenta la mayor frecuencia absoluta ajustada, con 932,87 por cada 1.000 registros (93,29 %). Entre los códigos individuales, destaca el 08123 con 8,11 (0,81 %), seguido del 42115 con 6,52. Esto evidencia que los registros del uso de agua en la minería de Estados Unidos se distribuyen entre numerosas ubicaciones geográficas, con una marcada concentración en los códigos agrupados como otros.