Export estimates for proportion aware of status from a Shiny90 output file to five-year age groups 15-19 to 50+.

extract_shiny90_age_sex(shiny90_path, pjnz_path = NULL, years = NULL)

Arguments

shiny90_path

file path to .shiny90 digest file.

pjnz_path

file path to PJNZ file

years

year(s) to generate estimates; an integer or a vector of integers. If NULL, all years available in estimates are returned (default).

Value

A data frame consisting of the number of PLHIV, aware of status and on ART by sex and five year age group 15-49 and age 50+ for specified years.

Details

The 'artnum' divided by 'plhiv' columns in the output will give a different ART coverage than Spectrum output for the same year because these outputs are based on the internal mid-year ART coverage in Spectrum, while Spectrum reports an end of year (Dec 31) ART coverage.

Examples


pjnz <- system.file("extdata/demo_mwi2019.PJNZ", package = "naomi")
shiny90dir <- tempfile()
utils::unzip(pjnz, "malawi.zip.shiny90", exdir = shiny90dir)
shiny90_path <- file.path(shiny90dir, "malawi.zip.shiny90")

extract_shiny90_age_sex(shiny90_path, pjnz, year = 2010:2019)
#>       area year    sex agegr hivstatus     plhiv      aware     artnum
#> 1   Malawi 2010 female 15-19  positive  27683.72  15266.408   4381.599
#> 2   Malawi 2011 female 15-19  positive  28183.36  16279.563   6122.000
#> 3   Malawi 2012 female 15-19  positive  28603.07  17260.667   8396.273
#> 4   Malawi 2013 female 15-19  positive  28882.68  17452.191  10490.296
#> 5   Malawi 2014 female 15-19  positive  29064.81  18012.046  12282.135
#> 6   Malawi 2015 female 15-19  positive  29187.39  18559.369  13619.078
#> 7   Malawi 2016 female 15-19  positive  29244.18  19362.446  15466.313
#> 8   Malawi 2017 female 15-19  positive  29053.52  21266.472  17402.425
#> 9   Malawi 2018 female 15-19  positive  28656.27  22357.327  18884.849
#> 10  Malawi 2019 female 15-19  positive  28070.55  22596.591  19479.052
#> 11  Malawi 2010   male 15-19  positive  11749.82   6131.658   3320.775
#> 12  Malawi 2011   male 15-19  positive  12767.52   7009.456   4271.046
#> 13  Malawi 2012   male 15-19  positive  13654.40   7776.337   5311.768
#> 14  Malawi 2013   male 15-19  positive  14406.60   8448.882   6313.194
#> 15  Malawi 2014   male 15-19  positive  15040.15   9241.806   7272.166
#> 16  Malawi 2015   male 15-19  positive  15594.00  10028.171   8179.690
#> 17  Malawi 2016   male 15-19  positive  16052.38  10805.027   9069.360
#> 18  Malawi 2017   male 15-19  positive  16358.26  11850.914  10097.032
#> 19  Malawi 2018   male 15-19  positive  16540.43  12780.792  11120.259
#> 20  Malawi 2019   male 15-19  positive  16622.07  13417.919  11518.660
#> 21  Malawi 2010 female 20-24  positive  55619.65  37479.252   7398.818
#> 22  Malawi 2011 female 20-24  positive  56161.13  39921.811  10925.906
#> 23  Malawi 2012 female 20-24  positive  56371.46  41643.686  15691.178
#> 24  Malawi 2013 female 20-24  positive  56138.36  41811.447  20227.533
#> 25  Malawi 2014 female 20-24  positive  55595.22  42086.372  23792.162
#> 26  Malawi 2015 female 20-24  positive  54945.18  42227.077  26439.041
#> 27  Malawi 2016 female 20-24  positive  54330.57  42768.444  29937.306
#> 28  Malawi 2017 female 20-24  positive  53637.89  44891.748  33784.134
#> 29  Malawi 2018 female 20-24  positive  52809.09  45973.971  36742.602
#> 30  Malawi 2019 female 20-24  positive  51777.23  45970.899  38154.877
#> 31  Malawi 2010   male 20-24  positive  19441.86   8893.872   1765.231
#> 32  Malawi 2011   male 20-24  positive  20491.95   9714.336   2500.187
#> 33  Malawi 2012   male 20-24  positive  21460.42  10424.568   3355.655
#> 34  Malawi 2013   male 20-24  positive  22218.18  10930.351   4224.123
#> 35  Malawi 2014   male 20-24  positive  22793.39  11613.465   5392.836
#> 36  Malawi 2015   male 20-24  positive  23251.61  12314.176   6431.330
#> 37  Malawi 2016   male 20-24  positive  23649.79  13191.923   7868.122
#> 38  Malawi 2017   male 20-24  positive  23921.54  14793.458   9594.242
#> 39  Malawi 2018   male 20-24  positive  24045.37  16117.992  11221.598
#> 40  Malawi 2019   male 20-24  positive  24017.19  16965.905  11736.147
#> 41  Malawi 2010 female 25-29  positive  72711.24  55680.031  15202.328
#> 42  Malawi 2011 female 25-29  positive  72166.53  58092.235  19631.225
#> 43  Malawi 2012 female 25-29  positive  72459.45  60229.755  25984.353
#> 44  Malawi 2013 female 25-29  positive  73420.73  61605.896  32335.536
#> 45  Malawi 2014 female 25-29  positive  74681.21  63410.863  38040.260
#> 46  Malawi 2015 female 25-29  positive  75780.35  65032.802  42777.997
#> 47  Malawi 2016 female 25-29  positive  76322.18  66548.629  48102.378
#> 48  Malawi 2017 female 25-29  positive  76003.17  68839.440  53441.662
#> 49  Malawi 2018 female 25-29  positive  74868.61  69481.267  57163.604
#> 50  Malawi 2019 female 25-29  positive  73166.72  68728.162  58657.654
#> 51  Malawi 2010   male 25-29  positive  37543.01  23623.900   4349.519
#> 52  Malawi 2011   male 25-29  positive  37192.65  23730.526   5361.153
#> 53  Malawi 2012   male 25-29  positive  37369.49  23773.915   6501.972
#> 54  Malawi 2013   male 25-29  positive  37952.27  23784.395   7595.678
#> 55  Malawi 2014   male 25-29  positive  38773.95  24424.362   9289.791
#> 56  Malawi 2015   male 25-29  positive  39606.63  25284.539  10858.342
#> 57  Malawi 2016   male 25-29  positive  40237.33  26483.871  13078.175
#> 58  Malawi 2017   male 25-29  positive  40424.61  28888.282  15890.509
#> 59  Malawi 2018   male 25-29  positive  40146.24  30566.350  18512.385
#> 60  Malawi 2019   male 25-29  positive  39512.87  31263.827  19126.693
#> 61  Malawi 2010 female 30-34  positive  85675.62  69574.758  23432.959
#> 62  Malawi 2011 female 30-34  positive  84748.91  72492.640  28992.573
#> 63  Malawi 2012 female 30-34  positive  83579.92  73862.844  36121.084
#> 64  Malawi 2013 female 30-34  positive  82392.45  73807.049  42389.454
#> 65  Malawi 2014 female 30-34  positive  81408.85  73755.557  47572.814
#> 66  Malawi 2015 female 30-34  positive  80865.28  73862.349  51741.930
#> 67  Malawi 2016 female 30-34  positive  80987.56  74709.511  56762.190
#> 68  Malawi 2017 female 30-34  positive  81741.95  77114.737  62556.001
#> 69  Malawi 2018 female 30-34  positive  82964.66  79422.855  67795.021
#> 70  Malawi 2019 female 30-34  positive  84240.22  81241.453  71563.235
#> 71  Malawi 2010   male 30-34  positive  56351.93  40788.883   9543.201
#> 72  Malawi 2011   male 30-34  positive  54948.73  40975.010  11384.250
#> 73  Malawi 2012   male 30-34  positive  53496.78  40289.383  13145.395
#> 74  Malawi 2013   male 30-34  positive  52112.31  39084.437  14485.785
#> 75  Malawi 2014   male 30-34  positive  50939.25  38282.026  16106.459
#> 76  Malawi 2015   male 30-34  positive  50142.89  37841.964  17534.407
#> 77  Malawi 2016   male 30-34  positive  49863.71  38152.746  19684.917
#> 78  Malawi 2017   male 30-34  positive  50055.50  40177.991  22910.885
#> 79  Malawi 2018   male 30-34  positive  50592.26  42298.341  26389.802
#> 80  Malawi 2019   male 30-34  positive  51222.08  43956.982  27830.450
#> 81  Malawi 2010 female 35-39  positive  78133.65  57835.978  26516.958
#> 82  Malawi 2011 female 35-39  positive  80836.15  65034.880  33638.712
#> 83  Malawi 2012 female 35-39  positive  83273.44  70832.107  42732.434
#> 84  Malawi 2013 female 35-39  positive  85296.75  74893.820  51043.136
#> 85  Malawi 2014 female 35-39  positive  86693.60  77851.545  57490.090
#> 86  Malawi 2015 female 35-39  positive  87361.80  79662.356  62556.840
#> 87  Malawi 2016 female 35-39  positive  87300.20  80648.931  67278.436
#> 88  Malawi 2017 female 35-39  positive  86629.41  81530.930  71534.178
#> 89  Malawi 2018 female 35-39  positive  85654.83  81776.143  74375.324
#> 90  Malawi 2019 female 35-39  positive  84703.13  81591.778  75657.429
#> 91  Malawi 2010   male 35-39  positive  60904.67  39791.190  14434.121
#> 92  Malawi 2011   male 35-39  positive  61180.39  42883.782  17634.101
#> 93  Malawi 2012   male 35-39  positive  61371.24  44890.742  20856.227
#> 94  Malawi 2013   male 35-39  positive  61412.19  46007.304  23553.123
#> 95  Malawi 2014   male 35-39  positive  61161.82  46662.582  25862.877
#> 96  Malawi 2015   male 35-39  positive  60555.19  46835.348  27788.419
#> 97  Malawi 2016   male 35-39  positive  59580.64  46772.999  29903.901
#> 98  Malawi 2017   male 35-39  positive  58323.36  47198.631  32741.623
#> 99  Malawi 2018   male 35-39  positive  56984.78  47566.818  35341.333
#> 100 Malawi 2019   male 35-39  positive  55777.67  47686.551  35623.029
#> 101 Malawi 2010 female 40-44  positive  54769.49  39257.773  20768.439
#> 102 Malawi 2011 female 40-44  positive  58779.68  46146.204  26986.167
#> 103 Malawi 2012 female 40-44  positive  62948.50  52703.645  35105.190
#> 104 Malawi 2013 female 40-44  positive  67225.34  58507.832  43227.139
#> 105 Malawi 2014 female 40-44  positive  71581.10  64139.224  50604.495
#> 106 Malawi 2015 female 40-44  positive  76272.92  69761.517  57888.121
#> 107 Malawi 2016 female 40-44  positive  79732.02  74161.925  64654.012
#> 108 Malawi 2017 female 40-44  positive  82643.17  78406.212  71136.194
#> 109 Malawi 2018 female 40-44  positive  84885.45  81677.939  76239.528
#> 110 Malawi 2019 female 40-44  positive  86346.63  83814.202  79378.492
#> 111 Malawi 2010   male 40-44  positive  49441.20  31535.131  14129.315
#> 112 Malawi 2011   male 40-44  positive  51464.88  35537.967  17831.782
#> 113 Malawi 2012   male 40-44  positive  53383.71  38920.647  21756.509
#> 114 Malawi 2013   male 40-44  positive  55180.37  41722.828  25403.768
#> 115 Malawi 2014   male 40-44  positive  56886.97  44331.852  28637.564
#> 116 Malawi 2015   male 40-44  positive  58890.71  46977.426  31980.672
#> 117 Malawi 2016   male 40-44  positive  59828.19  48764.145  35073.581
#> 118 Malawi 2017   male 40-44  positive  60462.24  50830.156  38882.922
#> 119 Malawi 2018   male 40-44  positive  60765.70  52527.532  42394.651
#> 120 Malawi 2019   male 40-44  positive  60692.99  53549.573  43418.543
#> 121 Malawi 2010 female 45-49  positive  34093.41  24158.991  14860.199
#> 122 Malawi 2011 female 45-49  positive  37469.61  29185.968  19267.035
#> 123 Malawi 2012 female 45-49  positive  41192.48  34317.923  25154.355
#> 124 Malawi 2013 female 45-49  positive  45143.00  39169.341  31219.996
#> 125 Malawi 2014 female 45-49  positive  49085.89  43942.991  36693.329
#> 126 Malawi 2015 female 45-49  positive  52544.39  48126.252  41762.551
#> 127 Malawi 2016 female 45-49  positive  56888.85  53099.345  47898.055
#> 128 Malawi 2017 female 45-49  positive  61188.47  58306.015  54221.943
#> 129 Malawi 2018 female 45-49  positive  65408.73  63236.374  60093.254
#> 130 Malawi 2019 female 45-49  positive  69595.73  67886.274  65169.885
#> 131 Malawi 2010   male 45-49  positive  33729.01  21546.671  11840.175
#> 132 Malawi 2011   male 45-49  positive  36022.05  25032.048  14991.448
#> 133 Malawi 2012   male 45-49  positive  38566.28  28432.537  18586.620
#> 134 Malawi 2013   male 45-49  positive  41226.37  31686.668  22218.768
#> 135 Malawi 2014   male 45-49  positive  43735.04  34830.218  25409.381
#> 136 Malawi 2015   male 45-49  positive  45560.10  37338.402  28304.910
#> 137 Malawi 2016   male 45-49  positive  47960.89  40322.588  31795.962
#> 138 Malawi 2017   male 45-49  positive  50085.82  43447.281  35879.111
#> 139 Malawi 2018   male 45-49  positive  51946.06  46283.143  39762.953
#> 140 Malawi 2019   male 45-49  positive  53678.76  48747.443  41860.854
#> 141 Malawi 2010 female 50-99  positive  46406.36  30046.911  21775.700
#> 142 Malawi 2011 female 50-99  positive  50615.39  36712.216  27697.882
#> 143 Malawi 2012 female 50-99  positive  55466.83  43678.183  35457.632
#> 144 Malawi 2013 female 50-99  positive  61008.03  50580.910  43642.910
#> 145 Malawi 2014 female 50-99  positive  67234.06  57997.977  51625.714
#> 146 Malawi 2015 female 50-99  positive  74149.61  65936.089  60194.392
#> 147 Malawi 2016 female 50-99  positive  81755.93  74573.836  70060.592
#> 148 Malawi 2017 female 50-99  positive  89984.38  84267.800  80831.020
#> 149 Malawi 2018 female 50-99  positive  98750.53  94289.740  91692.658
#> 150 Malawi 2019 female 50-99  positive 107891.05 104309.792 101935.179
#> 151 Malawi 2010   male 50-99  positive  43512.14  25676.657  17249.662
#> 152 Malawi 2011   male 50-99  positive  47091.63  30790.732  22014.533
#> 153 Malawi 2012   male 50-99  positive  51166.08  36056.086  27495.354
#> 154 Malawi 2013   male 50-99  positive  55722.89  41493.886  33340.062
#> 155 Malawi 2014   male 50-99  positive  60701.77  47352.344  38987.425
#> 156 Malawi 2015   male 50-99  positive  66094.16  53542.045  45180.230
#> 157 Malawi 2016   male 50-99  positive  71892.19  60216.575  52212.482
#> 158 Malawi 2017   male 50-99  positive  78028.16  67747.150  60625.676
#> 159 Malawi 2018   male 50-99  positive  84400.52  75519.233  69331.520
#> 160 Malawi 2019   male 50-99  positive  90880.78  83099.996  75898.624