Autors:
Dr. Marco Antonio Pérez-Méndez Dra. Hortensia Moreno Macias Mtra. Jocabed Sánchez Martínez
In this user guide you can see how to use Mexican Regional Gross Domestic Product package (mrgdp). We built several functions to download economic census, filter municipal data and join several years.
mrgdp package allows to download, select, clean and built variables from mexican economic census for several years (2004, 2009, 2014 and 2019) and all federal entities. We can filter the census data table by municipal data and build a data.frame for all federal entities and several years. With this data frame we can test a regional convergence hypotesis with econometric models.
The objectives resesearch are: 1) identifie correct data to built municipal gross domestic product proxy variable; 2) select any federal entitie to built, for several years, the municipal gross domestic product for 2004, 2009, 2014 and 2019; 3) create a data frame with municipal gross domestic product to run an econometric model to test regional convergence hypotesis.
This version of “Mexican Regional Gross Domestic Product” (mrgdp) package include 4 basic functions: 1.- Economic_units() 2.- pbt_munR() 3.- economic_census() 4.- PBTM_04-19()
The internal process of any function is:
The arguments for functions are:
state | entitie |
---|---|
“ags” | Aguascalientes |
“bc” | Baja California |
“bcs” | Baja California Sur |
“camp” | Campeche |
“coah” | Coahuila |
“col” | Colima |
“chis” | Chiapas |
“chih” | Chihuahua |
“cdmx” | Ciudad de México |
“dgo” | Durango |
“gto” | Guanajuato |
“gro” | Guerrero |
“hgo” | Hidalgo |
“jal” | Jalisco |
“mex” | México |
“mich” | Michoacán |
“mor” | Morelos |
“nay” | Nayarit |
“nl” | Nuevo León |
“pue” | Puebla |
“qro” | Queretaro |
“qroo” | Quintana Roo |
“slp” | San Luis Potosí |
“sin” | Sinaloa |
“son” | Sonora |
“tab” | Tabasco |
“tamps” | Tamaulipas |
“tlax” | Tlaxcala |
“ver” | Veracruz |
“yuc” | Yucatán |
“zac” | Zacatecas |
“oax” | Oaxaca |
select economic_census() function and type ‘2004’ and “ags”. The function downloads the economic census for federal entitie and year selected. With names() function we can see the names of all variables on economic census.
[1] “entidad” “municipio” “codigo” “id_estrato” [5] “ue” “a111a”
“a121a” “a131a”
[9] “a211a” “a221a” “a511a” “a700a”
[13] “a800a” “h000a” “h000b” “h000c”
[17] “h000d” “h001a” “h001b” “h001c”
[21] “h001d” “h010a” “h010b” “h010c”
[25] “h010d” “h020a” “h020b” “h020c”
[29] “h020d” “h101a” “h101b” “h101c”
[33] “h101d” “h203a” “h203b” “h203c”
[37] “h203d” “i000a” “i000b” “i000c”
[41] “i000d” “i100a” “i100b” “i100c”
[45] “i100d” “i200a” “i200b” “i200c”
[49] “i200d” “j000a” “j010a” “j203a”
[53] “j300a” “j400a” “j500a” “j600a”
[57] “k000a” “k010a” “k020a” “k030a”
[61] “k042a” “k412a” “k050a” “k060a”
[65] “k070a” “k090a” “k096a” “k311a”
[69] “k610a” “k620a” “k810a” “k820a”
[73] “k910a” “k950a” “k976a” “m000a”
[77] “m010a” “m020a” “m030a” “m050a”
[81] “m090a” “m091a” “m700a” “o010a”
[85] “o020a” “p000a” “p000b” “p000c”
[89] “p030a” “p030b” “p030c” “p100a”
[93] “p100b” “q000a” “q000b” “q000c”
[97] “q000d” “q010a” “q020a” “q030a”
[101] “q400a” “q900a” “a112a” “a113a”
[105] “a114a” “a115a” “a116a” “a117a”
[109] “a118a” “a119a” “a141a” “a143a”
[113] “a144a” “a145a” “a146a” “a147a”
[117] “a148a” “a149a” “a151a” “a152a”
[121] “a153a” “a154a” “a155a” “a156a”
[125] “a157a” “a158a” “a159a” “a171a”
[129] “a173a” “a174a” “a175a” “a176a”
[133] “a177a” “a179a” “a181a” “a182a”
[137] “a192a” “a193a” “a194a” “a195a”
[141] “a197a” “a201a” “a202a” “a204a”
[145] “a206a” “a208a” “a209a” “a212a”
[149] “a213a” “a214a” “a215a” “a216a”
[153] “a217a” “a218a” “a219a” “a222a”
[157] “a223a” “a224a” “a225a” “a226a”
[161] “a227a” “a228a” “a229a” “a231a”
[165] “a235a” “a236a” “a237a” “a238a”
[169] “a242a” “a243a” “a244a” “a245a”
[173] “a247a” “a248a” “a252a” “a253a”
[177] “a256a” “a433a” “a434a” “a436a”
[181] “a529a” “a534a” “a747a” “a748a”
[185] “a752a” “a764a”
Show in New Window Description:df [6 × 3]
entidad
11009 01 9 671.078 11379 01 10 224.185 11677 01 11 3980.801
6 rows Show in New Window Description:df [6 × 6]
Entidad
8 01 8 24.947 55.888 71.758
9 01 9 671.078 1477.156 1725.812
10 01 10 224.185 56.259 118.744 11 01 11 3980.801 7271.449
11322.543
6 rows | 1-6 of 6 columns
Once economic census is downloaded, we can filter values by municipality. This action is reached by pbt_mun() function, this function selects the correct variable that represents a proxy variable of municipal gross domestic product. With tail() function we can see the last six rows of data frame.
entidad
11009 01 9 671.078 11379 01 10 224.185 11677 01 11 3980.801
6 rows Show in New Window Description:df [6 × 6]
Entidad
8 01 8 24.947 55.888 71.758
9 01 9 671.078 1477.156 1725.812
10 01 10 224.185 56.259 118.744 11 01 11 3980.801 7271.449
11322.543
6 rows | 1-6 of 6 columns
as we can see, tail function shows the last six observations in data set. The last one in column “municipio” indicates the number of municipalities into the entity. In this case, Aguascalientes has eleven municipalities.
If we are interested in build a data set with many years for this entity, we can run the PIBM_04_19() function:
Entidad
8 01 8 24.947 55.888 71.758
9 01 9 671.078 1477.156 1725.812
10 01 10 224.185 56.259 118.744 11 01 11 3980.801 7271.449
11322.543
6 rows | 1-6 of 6 columns