dev/data-define-reusable.R

# Author: IK
# Date: 2018-10-12 UPD: 2021-01-13
################################################################################



# logic of data objects naming --------------------------------------------
# First 3 letters -- type of data, ususally pop or dth
# Then index of age grouping: 1, 5 or A (abridged)
# One letter index of sex: f or m (no index -- both sex)
# _ followed by arbitrary indicator of the specific data

# Source to be copied to R/data.R description


# India males population 1991
# Source:
pop1m_ind <- c(
    9544406, 7471790, 11590109, 11881844, 11872503, 12968350, 11993151, 10033918,
    14312222, 8111523, 15311047, 6861510, 13305117, 7454575, 9015381, 10325432,
    9055588, 5519173, 12546779, 4784102, 13365429, 4630254, 9595545, 4727963,
    5195032, 15061479, 5467392, 4011539, 8033850, 1972327, 17396266, 1647397,
    6539557, 2233521, 2101024, 16768198, 3211834, 1923169, 4472854, 1182245,
    15874081, 1017752, 3673865, 1247304, 1029243, 12619050, 1499847, 1250321,
    2862148, 723195, 12396632, 733501, 2186678, 777379, 810700, 7298270,
    1116032, 650402, 1465209, 411834, 9478824, 429296, 1190060, 446290, 362767,
    4998209, 388753, 334629, 593906, 178133, 4560342, 179460,
    481230, 159087, 155831, 1606147, 166763, 93569, 182238, 53567, 1715697,
    127486, 150782, 52332, 48664, 456387, 46978, 34448, 44015, 19172,
    329149, 48004, 28574, 9200, 7003, 75195, 13140, 5889, 18915, 21221, 72373
)

usethis::use_data(pop1m_ind, overwrite = T)



# Population array 5 year age groups 1950-1954
# Source: 
pop5_mat <- structure(
    c(54170, 44775, 42142, 38464, 34406, 30386, 26933,
      23481, 20602, 16489, 14248, 9928, 8490, 4801, 3599, 2048, 941,
      326, 80, 17, 0, 57424, 44475, 41752, 39628, 34757, 30605, 27183,
      23792, 20724, 17056, 14059, 10585, 8103, 5306, 3367, 2040, 963,
      315, 80, 16, 1, 60272, 44780, 41804, 40229, 35155, 30978, 27456,
      24097, 20873, 17546, 13990, 11146, 7841, 5738, 3184, 2062, 961,
      311, 80, 15, 1, 62727, 45681, 42101, 40474, 35599, 31439, 27758,
      24396, 21055, 17958, 14046, 11589, 7731, 6060, 3086, 2083, 949,
      312, 79, 14, 1, 64816, 47137, 42508, 40532, 36083, 31940, 28092,
      24693, 21274, 18299, 14223, 11906, 7785, 6255, 3090, 2084, 938,
      316, 80, 14, 2),
    .Dim = c(21L, 5L),
    .Dimnames = list(seq(0, 100, by = 5), 1950:1954)
)

usethis::use_data(pop5_mat, overwrite = T)


# Male population by 5 year age groups from PASEX AGESMTH
pop5m_pasex <- c(
  642367, 515520, 357831, 275542, 268336, 278601, 242515, 198231,
  165937, 122756, 96775, 59307, 63467, 32377, 29796, 16183, 34729
)

usethis::use_data(pop5m_pasex, overwrite = T)


# Male single year age group population from PASEX SINGAGE
pop1m_pasex <- c(
  80626, 95823, 104315, 115813, 100796, 105086, 97266, 116328,
  75984, 89982, 95525, 56973, 78767, 65672, 53438, 85014,
  47600, 64363, 42195, 42262, 73221, 30080, 34391, 29072,
  20531, 66171, 24029, 44227, 24128, 23599, 82088, 16454,
  22628, 17108, 12531, 57325, 17220, 28425, 16206, 17532,
  65976, 11593, 15828, 13541, 8133, 44696, 11165, 18543,
  12614, 12041, 55798, 9324, 10772, 10453, 6773, 28358,
  9916, 13348, 8039, 7583, 42470, 5288, 5317, 6582,
  3361, 17949, 3650, 5873, 3279, 3336, 27368, 1965,
  2495, 2319, 1335, 12022, 1401, 1668, 1360, 1185,
  9167, 424, 568, 462, 282, 6206, 343, 409, 333, 291, 
  4137, 133, 169, 157, 89, 2068, 68, 81, 66, 57
)

usethis::use_data(pop1m_pasex, overwrite = T)


# Feeney zigzag -- deaths in South Africa 1997
dth5_zigzag <- c(
  13331, 4151, 1746, 1585, 3859, 8354, 11146, 12076, 12216, 12016, 
  12473, 11513, 12899, 11413, 12710, 11516, 11408, 6733, 4031, 2069
)

usethis::use_data(dth5_zigzag, overwrite = T)


# Abridged populations from PAS AGEINT
popA_earlier <- c(
  100958, 466275, 624134, 559559, 446736, 370653, 301862, 249409, 247473, 
  223014, 172260, 149338, 127242, 105715, 79614, 53660, 31021, 34596
)

usethis::use_data(popA_earlier, overwrite = T)

popA_later <- c(
  201916, 932550, 1248268, 1119118, 893472, 741306, 603724, 498818, 494946, 
  446028, 344520, 298676, 254484, 211430, 159228, 107320, 62042, 69192
)

usethis::use_data(popA_later, overwrite = T)


# Male population by 1 year age groups from Russian census help on 2002-10-16
# Source: http://www.demoscope.ru/weekly/ssp/rus2002_01.php
pop1m_rus2002 <- c(682698L, 641551L, 644671L, 644652L, 662998L, 659306L, 678341L, 717053L, 740366L, 753300L, 875113L, 963123L, 1081671L, 1145059L, 1247787L, 1314341L, 1291147L, 1266227L, 1306873L, 1325599L, 1234028L, 1162951L, 1170248L, 1115312L, 1100598L, 1088833L, 1092321L, 1070733L, 1045802L, 1016461L, 1061391L, 994896L, 1007712L, 933628L, 916902L, 929632L, 957895L, 981477L, 1039571L, 1116279L, 1195521L, 1210704L, 1278766L, 1216728L, 1182385L, 1167289L, 1123058L, 1117150L, 1087663L, 998307L, 1035886L, 951627L, 960428L, 963751L, 730354L, 798841L, 604983L, 382611L, 298788L, 280702L, 493677L, 625270L, 694930L, 741777L, 695339L, 693911L, 559111L, 467811L, 358252L, 364999L, 427681L, 405822L, 435844L, 385155L, 379150L, 317841L, 258185L, 193023L, 154406L, 112987L, 89944L, 73858L, 63570L, 54955L, 47194L, 30300L, 28748L, 29419L, 26635L, 20166L, 16673L, 10857L, 8189L, 4839L, 3333L, 2287L, 1458L, 984L, 644L, 488L, 967L)
usethis::use_data(pop1m_rus2002, overwrite = T)

# Male population by 1 year age groups from Russian census help on 2010-10-25
# Source: http://www.demoscope.ru/weekly/ssp/rus_age1_10.php
pop1m_rus2010 <- c(842354L, 859562L, 849138L, 788376L, 744105L, 750282L, 748514L, 746626L, 709493L, 675127L, 683827L, 656887L, 678395L, 669374L, 696685L, 743449L, 774172L, 800765L, 923952L, 1035555L, 1167860L, 1187193L, 1252421L, 1300116L, 1262584L, 1247974L, 1230926L, 1249086L, 1156502L, 1125283L, 1182017L, 1088248L, 1073221L, 1038733L, 1051852L, 1046293L, 1008882L, 983045L, 985075L, 949072L, 980924L, 881915L, 866214L, 859808L, 885432L, 926771L, 951739L, 1015812L, 1051749L, 1093184L, 1155128L, 1076307L, 1043777L, 1005283L, 967830L, 964217L, 919814L, 837341L, 841362L, 789019L, 787516L, 775999L, 585545L, 624976L, 471186L, 295668L, 222526L, 205594L, 336318L, 431670L, 471562L, 485883L, 446533L, 438107L, 337694L, 273086L, 198303L, 190828L, 210878L, 195219L, 200564L, 162820L, 151191L, 120794L, 93394L, 66247L, 48072L, 32932L, 23840L, 18087L, 13839L, 10228L, 7790L, 4327L, 3544L, 3137L, 2380L, 1666L, 1137L, 687L, 1379L)
usethis::use_data(pop1m_rus2010, overwrite = T)
timriffe/DemoTools documentation built on Jan. 28, 2024, 5:13 a.m.