The RAM-OP Workflow

Ernest Guevarra

The RAM-OP Workflow is summarised in the diagram below.

RAM-OP workflow

The oldr package provides functions to use for all steps after data collection. These functions were developed specifically for the data structure created by the EpiData or the Open Data Kit collection tools. The data structure produced by these collection tools is shown by the dataset testSVY included in the oldr package.

testSVY
#> # A tibble: 192 × 90
#>      ad2   psu    hh    id    d1    d2    d3    d4    d5    f1   f2a   f2b   f2c
#>    <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int>
#>  1     1   201     1     1     1    67     2     5     2     3     2     1     1
#>  2     1   201     2     1     1    74     1     2     2     3     2     1     1
#>  3     1   201     3     1     1    60     1     2     2     2     2     2     2
#>  4     1   201     3     2     1    60     2     2     2     3     2     2     1
#>  5     1   201     4     1     1    85     2     5     2     3     2     1     1
#>  6     1   201     5     1     2    86     1     5     1     4     2     1     1
#>  7     1   201     6     1     1    80     1     5     2     3     2     1     1
#>  8     1   201     6     2     1    60     2     5     2     3     2     2     1
#>  9     1   201     7     1     1    62     1     2     2     2     2     1     1
#> 10     1   201     8     1     1    72     2     5     2     2     2     1     1
#> # ℹ 182 more rows
#> # ℹ 77 more variables: f2d <int>, f2e <int>, f2f <int>, f2g <int>, f2h <int>,
#> #   f2i <int>, f2j <int>, f2k <int>, f2l <int>, f2m <int>, f2n <int>,
#> #   f2o <int>, f2p <int>, f2q <int>, f2r <int>, f2s <int>, f3 <int>, f4 <int>,
#> #   f5 <int>, f6 <int>, f7 <int>, a1 <int>, a2 <int>, a3 <int>, a4 <int>,
#> #   a5 <int>, a6 <int>, a7 <int>, a8 <int>, k6a <int>, k6b <int>, k6c <int>,
#> #   k6d <int>, k6e <int>, k6f <int>, ds1 <int>, ds2 <int>, ds3 <int>, …

Processing and recoding data

Once RAM-OP data is collected, it will need to be processed and recoded based on the definitions of the various indicators included in RAM-OP. The oldr package provides a suite functions to perform this processing and recoding. These functions and their syntax can be easily remembered as the create_op_ functions as their function names start with the create_ verb followed by the op_ label and then followed by an indicator or indicator set specific identifier or short name. Finally, an additional tag for male or female can be added to the main function to provide gender-specific outputs.

Currently, a standard RAM-OP can provide results for the 13 indicators or indicator sets for older people. The following table shows these indicators/indicator sets alongside the functions related to them:

Indicator / Indicator Set Related Functions
Demography and situation create_op_demo; create_op_demo_males; create_op_demo_females
Food intake create_op_food; create_op_food_males; create_op_food_females
Severe food insecurity create_op_hunger; create_op_hunger_males; create_op_hunger_females
Disability create_op_disability; create_op_disability_males; create_op_disability_females
Activities of daily living create_op_adl; create_op_adl_males; create_op_adl_females
Mental health and well-being create_op_mental; create_op_mental_males; create_op_mental_females
Dementia create_op_dementia; create_op_dementia_males; create_op_dementia_females
Health and health-seeking behaviour create_op_health; create_op_health_males; create_op_health_females
Sources of income create_op_income; create_op_income_males; create_op_income_females
Water, sanitation, and hygiene create_op_wash; create_op_wash_males; create_op_wash_females
Anthropometry and anthropometric screening coverage create_op_anthro; create_op_anthro_males; create_op_anthro_females
Visual impairment create_op_visual; create_op_visual_males; create_op_visual_females
Miscellaneous create_op_misc; create_op_misc_males; create_op_misc_females

A final function in the processing and recoding set - create_op - is provided to perform the processing and recoding of all indicators or indicator sets. This function allows for the specification of which indicators or indicator sets to process and recode which is useful for cases where not all the indicators or indicator sets have been collected or if only specific indicators or indicator sets need to be analysed or reported. This function also specifies whether a specific gender subset of the data is needed.

For a standard RAM-OP implementation, this step is performed in R as follows:

## Process and recode all standard RAM-OP indicators in the testSVY dataset
create_op(svy = testSVY)

which results in the following output:

#> # A tibble: 192 × 138
#>      psu  sex1  sex2 resp1 resp2 resp3 resp4   age ageGrp1 ageGrp2 ageGrp3
#>    <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <int>   <dbl>   <dbl>   <dbl>
#>  1   201     0     1     1     0     0     0    67       0       1       0
#>  2   201     1     0     1     0     0     0    74       0       0       1
#>  3   201     1     0     1     0     0     0    60       0       1       0
#>  4   201     0     1     1     0     0     0    60       0       1       0
#>  5   201     0     1     1     0     0     0    85       0       0       0
#>  6   201     1     0     0     1     0     0    86       0       0       0
#>  7   201     1     0     1     0     0     0    80       0       0       0
#>  8   201     0     1     1     0     0     0    60       0       1       0
#>  9   201     1     0     1     0     0     0    62       0       1       0
#> 10   201     0     1     1     0     0     0    72       0       0       1
#> # ℹ 182 more rows
#> # ℹ 127 more variables: ageGrp4 <dbl>, ageGrp5 <dbl>, marital1 <dbl>,
#> #   marital2 <dbl>, marital3 <dbl>, marital4 <dbl>, marital5 <dbl>,
#> #   marital6 <dbl>, alone <dbl>, MF <dbl>, DDS <dbl>, FG01 <dbl>, FG02 <dbl>,
#> #   FG03 <dbl>, FG04 <dbl>, FG05 <dbl>, FG06 <dbl>, FG07 <dbl>, FG08 <dbl>,
#> #   FG09 <dbl>, FG10 <dbl>, FG11 <dbl>, proteinRich <dbl>, pProtein <dbl>,
#> #   aProtein <dbl>, pVitA <dbl>, aVitA <dbl>, xVitA <dbl>, ironRich <dbl>, …

Estimating indicators

Once data has been processed and appropriate recoding for indicators has been performed, indicator estimates can now be calculated.

It is important to note that estimation procedures need to account for the sample design. All major statistical analysis software can do this (details vary). There are two things to note:

This sample design will need to be specified to statistical analysis software being used. If no weights are provided, then the analysis may produce estimates that place undue weight to observations from smaller communities with confidence intervals with lower than nominal coverage (i.e. they will be too narrow).

Blocked weighted bootstrap

The oldr package uses blocked weighted bootstrap estimation approach:

A total of m PSUs are sampled with-replacement from the survey dataset where m is the number of PSUs in the survey sample. Individual records within each PSU are then sampled with-replacement. A total of n records are sampled with-replacement from each of the selected PSUs where n is the number of individual records in a selected PSU. The resulting collection of records replicates the original survey in terms of both sample design and sample size. A large number of replicate surveys are taken (the standard RAM-OP software uses \(r = 399\) replicate surveys but this can be changed). The required statistic (e.g. the mean of an indicator value) is applied to each replicate survey. The reported estimate consists of the 50th (point estimate), 2.5th (lower 95% confidence limit), and the 97.5th (upper 95% confidence limit) percentiles of the distribution of the statistic observed across all replicate surveys. The blocked weighted bootstrap procedure is outlined in the figure below.

Blocked weighted bootstrap

The principal advantages of using a bootstrap estimator are:

PROBIT estimator

The prevalence of GAM, MAM, and SAM are estimated using a PROBIT estimator. This type of estimator provides better precision than a classic estimator at small sample sizes as discussed in the following literature:

World Health Organisation, Physical Status: The use and interpretation of anthropometry. Report of a WHO expert committee, WHO Technical Report Series 854, WHO, Geneva, 1995

Dale NM, Myatt M, Prudhon C, Briend, A, “Assessment of the PROBIT approach for estimating the prevalence of global, moderate and severe acute malnutrition from population surveys”, Public Health Nutrition, 1–6. https://doi.org/10.1017/s1368980012003345, 2012

Blanton CJ, Bilukha, OO, “The PROBIT approach in estimating the prevalence of wasting: revisiting bias and precision”, Emerging Themes in Epidemiology, 10(1), 2013, p. 8

An estimate of GAM prevalence can be made using a classic estimator:

\[ \text{prevalence} ~ = ~ \frac{\text{Number of respondents with MUAC < 210}}{\text{Total number of respondents}} \]

On the other hand, the estimate of GAM prevalence made from the RAM-OP survey data is made using a PROBIT estimator. The PROBIT function is also known as the inverse cumulative distribution function. This function converts parameters of the distribution of an indicator (e.g. the mean and standard deviation of a normally distributed variable) into cumulative percentiles. This means that it is possible to use the normal PROBIT function with estimates of the mean and standard deviation of indicator values in a survey sample to predict (or estimate) the proportion of the population falling below a given threshold. For example, for data with a mean MUAC of 256 mm and a standard deviation of 28 mm the output of the normal PROBIT function for a threshold of 210 mm is 0.0502 meaning that 5.02% of the population are predicted (or estimated) to fall below the 210 mm threshold.

Both the classic and the PROBIT methods can be thought of as estimating area:

RAM-OP estimators

The principal advantage of the PROBIT approach is that the required sample size is usually smaller than that required to estimate prevalence with a given precision using the classic method.

The PROBIT method assumes that MUAC is a normally distributed variable. If this is not the case then the distribution of MUAC is transformed towards normality.

The prevalence of SAM is estimated in a similar way to GAM. The prevalence of MAM is estimated as the difference between the GAM and SAM prevalence estimates:

\[ \widehat{\text{GAM prevalence}} ~ = ~ \widehat{\text{GAM prevalence}} - \widehat{\text{SAM prevalence}} \]

Classic estimator

The function estimateClassic in oldr implements the blocked weighted bootstrap classic estimator of RAM-OP. This function uses the bootClassic statistic to estimate indicator values.

The estimateClassic function is used for all the standard RAM-OP indicators except for anthropometry. The function is used as follows:

## Process and recode RAM-OP data (testSVY)
df <- create_op(svy = testSVY)

## Perform classic estimation on recoded data using appropriate weights provided by testPSU
classicDF <- estimate_classic(x = df, w = testPSU)

This results in (using limited replicates to reduce computing time):

#> # A tibble: 136 × 10
#>    INDICATOR  EST.ALL LCL.ALL UCL.ALL EST.MALES LCL.MALES UCL.MALES EST.FEMALES
#>    <chr>        <dbl>   <dbl>   <dbl>     <dbl>     <dbl>     <dbl>       <dbl>
#>  1 resp1      0.865    0.823   0.891     0.827    0.728      0.917       0.875 
#>  2 resp2      0.0938   0.075   0.131     0.0933   0.0353     0.162       0.0982
#>  3 resp3      0.0365   0.0229  0.0562    0.0533   0.00519    0.177       0.0175
#>  4 resp4      0.00521  0       0.0313    0.0123   0          0.0339      0     
#>  5 age       71.1     70.2    72.5      71.9     68.8       75.2        70.8   
#>  6 ageGrp1    0        0       0         0        0          0           0     
#>  7 ageGrp2    0.505    0.422   0.595     0.452    0.257      0.626       0.557 
#>  8 ageGrp3    0.240    0.186   0.3       0.286    0.136      0.360       0.188 
#>  9 ageGrp4    0.208    0.145   0.264     0.238    0.111      0.328       0.243 
#> 10 ageGrp5    0.0417   0.0115  0.0677    0.0714   0.0175     0.109       0.0182
#> # ℹ 126 more rows
#> # ℹ 2 more variables: LCL.FEMALES <dbl>, UCL.FEMALES <dbl>

PROBIT estimator

The function estimateProbit in oldr implements the blocked weighted bootstrap PROBIT estimator of RAM-OP. This function uses the probit_GAM and the probit_SAM statistic to estimate indicator values.

The estimateProbit function is used for only the anthropometric indicators. The function is used as follows:

## Process and recode RAM-OP data (testSVY)
df <- create_op(svy = testSVY)

## Perform probit estimation on recoded data using appropriate weights provided by testPSU
probitDF <- estimate_probit(x = df, w = testPSU)

This results in (using limited replicates to reduce computing time):

#> # A tibble: 3 × 10
#>   INDICATOR  EST.ALL   LCL.ALL UCL.ALL EST.MALES LCL.MALES UCL.MALES EST.FEMALES
#>   <chr>        <dbl>     <dbl>   <dbl>     <dbl>     <dbl>     <dbl>       <dbl>
#> 1 GAM       0.0273   0.00632   0.0419    7.18e-3  2.34e- 3   0.0261     0.0471  
#> 2 MAM       0.0234   0.00624   0.0415    6.02e-3  2.34e- 3   0.0261     0.0467  
#> 3 SAM       0.000502 0.0000413 0.00330   9.48e-8  1.67e-32   0.00160    0.000465
#> # ℹ 2 more variables: LCL.FEMALES <dbl>, UCL.FEMALES <dbl>

The two sets of estimates are then merged using the merge_op function as follows:

## Merge classicDF and probitDF
resultsDF <- merge_op(x = classicDF, y = probitDF)

resultsDF

which results in:

#> # A tibble: 139 × 13
#>    INDICATOR GROUP       LABEL TYPE  EST.ALL LCL.ALL UCL.ALL EST.MALES LCL.MALES
#>    <fct>     <fct>       <fct> <fct>   <dbl>   <dbl>   <dbl>     <dbl>     <dbl>
#>  1 resp1     Survey      Resp… Prop… 8.65e-1  0.823   0.891     0.827    0.728  
#>  2 resp2     Survey      Resp… Prop… 9.38e-2  0.075   0.131     0.0933   0.0353 
#>  3 resp3     Survey      Resp… Prop… 3.65e-2  0.0229  0.0562    0.0533   0.00519
#>  4 resp4     Survey      Resp… Prop… 5.21e-3  0       0.0313    0.0123   0      
#>  5 age       Demography… Mean… Mean  7.11e+1 70.2    72.5      71.9     68.8    
#>  6 ageGrp1   Demography… Self… Prop… 0        0       0         0        0      
#>  7 ageGrp2   Demography… Self… Prop… 5.05e-1  0.422   0.595     0.452    0.257  
#>  8 ageGrp3   Demography… Self… Prop… 2.40e-1  0.186   0.3       0.286    0.136  
#>  9 ageGrp4   Demography… Self… Prop… 2.08e-1  0.145   0.264     0.238    0.111  
#> 10 ageGrp5   Demography… Self… Prop… 4.17e-2  0.0115  0.0677    0.0714   0.0175 
#> # ℹ 129 more rows
#> # ℹ 4 more variables: UCL.MALES <dbl>, EST.FEMALES <dbl>, LCL.FEMALES <dbl>,
#> #   UCL.FEMALES <dbl>

Creating charts

Once indicators has been estimated, the outputs can then be used to create relevant charts to visualise the results. A set of functions that start with the verb chart_op_ is provided followed by the indicator identifier to specify the type of indicator to visualise. The output of the function is a PNG file saved in the specified filename appended to the indicator identifier within the current working directory or saved in the specified filename appended to the indicator identifier in the specified directory path.

The following shows how to produce the chart for ADLs saved with filename test appended at the start inside a temporary directory:

chart_op_adl(x = create_op(testSVY), filename = file.path(tempdir(), "test"))
#> png 
#>   2

The resulting PNG file can be found in the temporary directory

file.exists(path = file.path(tempdir(), "test.png"))
#> [1] FALSE

and will look something like this:

RAM-OP chart showing information on activities of daily living

Reporting estimates

Finally, estimates can be reported through report tables. The report_op_table function facilitates this through the following syntax:

report_op_table(estimates = resultsDF, filename = file.path(tempdir(), "TEST"))

The resulting CSV file is found in the temporary directory

file.exists(path = file.path(tempdir(), "TEST.csv"))
#> [1] FALSE

and will look something like this:

#>                              X  X.1     X.2     X.3     X.4     X.5     X.6
#> 1                       Survey                                             
#> 2                                       ALL                   MALES        
#> 3                    INDICATOR TYPE     EST     LCL     UCL     EST     LCL
#> 4                           99    2  0.8646  0.8229  0.8906  0.8267  0.7278
#> 5                           96    2  0.0938  0.0750  0.1313  0.0933  0.0353
#> 6                           98    2  0.0365  0.0229  0.0563  0.0533  0.0052
#> 7                           97    2  0.0052  0.0000  0.0313  0.0123  0.0000
#> 8                                                                          
#> 9     Demography and situation                                             
#> 10                                      ALL                   MALES        
#> 11                   INDICATOR TYPE     EST     LCL     UCL     EST     LCL
#> 12                          54    1 71.0781 70.2240 72.5094 71.8690 68.7771
#> 13                         106    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 14                         107    2  0.5052  0.4219  0.5948  0.4524  0.2568
#> 15                         108    2  0.2396  0.1865  0.3000  0.2857  0.1360
#> 16                         109    2  0.2083  0.1448  0.2635  0.2375  0.1114
#> 17                         105    2  0.0417  0.0115  0.0677  0.0714  0.0175
#> 18                         115    2  0.4167  0.3125  0.4573  1.0000  1.0000
#> 19                         114    2  0.5833  0.5427  0.6875  0.0000  0.0000
#> 20                          51    2  0.0208  0.0156  0.0583  0.0263  0.0000
#> 21                          49    2  0.2760  0.2615  0.3688  0.5000  0.4226
#> 22                          48    2  0.1250  0.0948  0.1552  0.1818  0.0790
#> 23                          47    2  0.0833  0.0406  0.1250  0.0750  0.0496
#> 24                          52    2  0.4583  0.3708  0.5667  0.1852  0.1583
#> 25                          50    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 26                         127    2  0.1406  0.1000  0.1615  0.2208  0.1055
#> 27                                                                         
#> 28                        Diet                                             
#> 29                                      ALL                   MALES        
#> 30                   INDICATOR TYPE     EST     LCL     UCL     EST     LCL
#> 31                          53    1  2.5677  2.4906  2.6833  2.4286  2.2449
#> 32                          25    1  4.4948  4.3615  4.7021  4.5200  4.2355
#> 33                          14    2  0.8958  0.8708  0.9469  0.8929  0.8413
#> 34                          23    2  0.5417  0.4750  0.5760  0.4878  0.4078
#> 35                          18    2  0.5833  0.5635  0.6604  0.5679  0.3863
#> 36                          20    2  0.0573  0.0396  0.0979  0.0247  0.0000
#> 37                          15    2  0.0521  0.0115  0.0615  0.0519  0.0000
#> 38                          17    2  0.2865  0.2510  0.3510  0.4405  0.3702
#> 39                          19    2  0.3958  0.3458  0.4740  0.4634  0.3394
#> 40                          21    2  0.0208  0.0010  0.0406  0.0000  0.0000
#> 41                          16    2  0.2031  0.1583  0.2750  0.2464  0.1436
#> 42                          24    2  0.5104  0.4604  0.5531  0.3951  0.3166
#> 43                          22    2  0.9635  0.9312  0.9917  0.9870  0.9540
#> 44                                                                         
#> 45                   Nutrients                                             
#> 46                                      ALL                   MALES        
#> 47                   INDICATOR TYPE     EST     LCL     UCL     EST     LCL
#> 48                          88    2  0.4583  0.4083  0.5573  0.4933  0.3647
#> 49                          89    2  0.3958  0.3458  0.4740  0.4634  0.3394
#> 50                          87    2  0.1354  0.0760  0.1542  0.0625  0.0303
#> 51                          83    2  0.6042  0.5885  0.6979  0.5238  0.4275
#> 52                           2    2  0.0625  0.0229  0.0854  0.0519  0.0024
#> 53                           3    2  0.6302  0.6167  0.7240  0.5802  0.4454
#> 54                          42    2  0.6667  0.6104  0.6813  0.6220  0.5587
#> 55                           9    2  0.0208  0.0010  0.0406  0.0000  0.0000
#> 56                         140    2  0.5729  0.5094  0.7021  0.7000  0.6584
#> 57                         135    2  0.6302  0.5615  0.7292  0.7143  0.6608
#> 58                         137    2  0.8125  0.7833  0.8531  0.8158  0.7575
#> 59                         138    2  0.5729  0.5094  0.7021  0.7000  0.6584
#> 60                         139    2  0.8802  0.8292  0.9010  0.8961  0.8296
#> 61                         136    2  0.3646  0.2969  0.4396  0.4667  0.3947
#> 62                         134    2  0.3490  0.2948  0.4365  0.4667  0.3947
#> 63                                                                         
#> 64               Food Security                                             
#> 65                                      ALL                   MALES        
#> 66                   INDICATOR TYPE     EST     LCL     UCL     EST     LCL
#> 67                          45    2  0.7708  0.7260  0.8375  0.8052  0.6179
#> 68                          60    2  0.1719  0.1198  0.2177  0.1375  0.0691
#> 69                         113    2  0.0260  0.0062  0.0469  0.0260  0.0121
#> 70                                                                         
#> 71             Disability (WG)                                             
#> 72                                      ALL                   MALES        
#> 73                   INDICATOR TYPE     EST     LCL     UCL     EST     LCL
#> 74                         129    2  1.0000  1.0000  1.0000  1.0000  1.0000
#> 75                         130    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 76                         131    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 77                         132    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 78                          28    2  1.0000  1.0000  1.0000  1.0000  1.0000
#> 79                          29    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 80                          30    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 81                          31    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 82                          55    2  1.0000  1.0000  1.0000  1.0000  1.0000
#> 83                          56    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 84                          57    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 85                          58    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 86                          92    2  1.0000  1.0000  1.0000  1.0000  1.0000
#> 87                          93    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 88                          94    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 89                          95    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 90                         101    2  1.0000  1.0000  1.0000  1.0000  1.0000
#> 91                         102    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 92                         103    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 93                         104    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 94                          10    2  1.0000  1.0000  1.0000  1.0000  1.0000
#> 95                          11    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 96                          12    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 97                          13    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 98                          63    2  1.0000  1.0000  1.0000  1.0000  1.0000
#> 99                           5    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 100                          6    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 101                          7    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 102                         62    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 103                                                                        
#> 104 Activities of daily living                                             
#> 105                                     ALL                   MALES        
#> 106                  INDICATOR TYPE     EST     LCL     UCL     EST     LCL
#> 107                         35    2  0.9740  0.9385  0.9896  0.9565  0.8536
#> 108                         37    2  0.9896  0.9667  1.0000  0.9750  0.8894
#> 109                         39    2  0.9896  0.9667  1.0000  0.9750  0.8894
#> 110                         40    2  0.9635  0.9354  0.9844  0.9740  0.8680
#> 111                         36    2  0.7448  0.6948  0.7771  0.7733  0.7533
#> 112                         38    2  1.0000  0.9865  1.0000  1.0000  0.9393
#> 113                         44    1  5.6562  5.5562  5.7250  5.6184  5.2207
#> 114                         41    2  0.9740  0.9490  0.9990  0.9750  0.8894
#> 115                         82    2  0.0104  0.0000  0.0344  0.0000  0.0000
#> 116                        112    2  0.0104  0.0000  0.0333  0.0250  0.0000
#> 117                        126    2  0.6250  0.5260  0.6698  0.5658  0.4569
#> 118                        125    2  0.1042  0.0729  0.1385  0.1299  0.0664
#> 119                                                                        
#> 120              Mental health                                             
#> 121                                     ALL                   MALES        
#> 122                  INDICATOR TYPE     EST     LCL     UCL     EST     LCL
#> 123                         43    1 12.2552 11.5052 12.9740 11.8312  9.8316
#> 124                        110    2  0.5156  0.4167  0.5406  0.5065  0.3637
#> 125                         85    2  0.2031  0.1521  0.2479  0.1558  0.0803
#> 126                                                                        
#> 127                     Health                                             
#> 128                                     ALL                   MALES        
#> 129                  INDICATOR TYPE     EST     LCL     UCL     EST     LCL
#> 130                         46    2  0.4844  0.3958  0.5365  0.3580  0.2745
#> 131                        128    2  0.7500  0.6731  0.8788  0.6207  0.4713
#> 132                         74    2  0.1071  0.0182  0.3771  0.2500  0.0333
#> 133                         79    2  0.3636  0.1643  0.4785  0.3333  0.0848
#> 134                         80    2  0.1000  0.0143  0.2661  0.0000  0.0000
#> 135                         81    2  0.1000  0.0069  0.1983  0.2143  0.0250
#> 136                         73    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 137                         77    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 138                         75    2  0.0455  0.0000  0.1629  0.0000  0.0000
#> 139                         78    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 140                         76    2  0.1000  0.0333  0.4494  0.2083  0.0143
#> 141                         91    2  0.8750  0.8219  0.9146  0.8442  0.7874
#> 142                          1    2  0.8095  0.7610  0.8716  0.7500  0.6377
#> 143                         65    2  0.0333  0.0000  0.1941  0.2105  0.0167
#> 144                         70    2  0.8750  0.6299  0.9575  0.7143  0.4942
#> 145                         71    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 146                         72    2  0.0345  0.0000  0.0920  0.1053  0.0105
#> 147                         64    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 148                         68    2  0.0400  0.0000  0.1018  0.0000  0.0000
#> 149                         66    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 150                         69    2  0.0000  0.0000  0.0276  0.0000  0.0000
#> 151                         67    2  0.0000  0.0000  0.0000  0.0000  0.0000
#> 152                          8    2  0.0260  0.0052  0.0312  0.0130  0.0000
#> 153                        133    2  0.3958  0.3510  0.4781  0.5195  0.3973
#> 154                         86    2  0.3333  0.2781  0.3542  0.2208  0.1869
#> 155                                                                        
#> 156                     Income                                             
#> 157                                     ALL                   MALES        
#> 158                  INDICATOR TYPE     EST     LCL     UCL     EST     LCL
#> 159                         27    2  0.5573  0.5260  0.6052  0.6667  0.5989
#> 160                        116    2  0.3698  0.3021  0.4302  0.5185  0.3709
#> 161                        124    2  0.1302  0.0750  0.1688  0.1829  0.1131
#> 162                        121    2  0.0208  0.0115  0.0406  0.0390  0.0029
#> 163                        123    2  0.0625  0.0260  0.1010  0.0132  0.0000
#> 164                        119    2  0.0052  0.0000  0.0146  0.0000  0.0000
#> 165                        122    2  0.0156  0.0000  0.0333  0.0250  0.0000
#> 166                        118    2  0.0208  0.0062  0.0344  0.0145  0.0026
#> 167                        117    2  0.3333  0.2771  0.3896  0.3537  0.2595
#> 168                        120    2  0.0052  0.0000  0.0188  0.0000  0.0000
#> 169                                                                        
#> 170                       WASH                                             
#> 171                                     ALL                   MALES        
#> 172                  INDICATOR TYPE     EST     LCL     UCL     EST     LCL
#> 173                         34    2  0.6198  0.5802  0.7010  0.5584  0.4049
#> 174                        100    2  0.7083  0.6542  0.7854  0.6310  0.4522
#> 175                         33    2  0.2604  0.2094  0.2958  0.2099  0.1462
#> 176                         32    2  0.2500  0.2000  0.2917  0.2099  0.1462
#> 177                                                                        
#> 178                     Relief                                             
#> 179                                     ALL                   MALES        
#> 180                  INDICATOR TYPE     EST     LCL     UCL     EST     LCL
#> 181                         84    2  0.0260  0.0156  0.0604  0.0290  0.0000
#> 182                          4    2  0.0417  0.0323  0.0615  0.0395  0.0000
#> 183                         90    2  0.0312  0.0083  0.0458  0.0238  0.0000
#> 184                                                                        
#> 185              Anthropometry                                             
#> 186                                     ALL                   MALES        
#> 187                  INDICATOR TYPE     EST     LCL     UCL     EST     LCL
#> 188                         26    2  0.0273  0.0063  0.0419  0.0072  0.0023
#> 189                         59    2  0.0234  0.0062  0.0415  0.0060  0.0023
#> 190                        111    2  0.0005  0.0000  0.0033  0.0000  0.0000
#>         X.7     X.8     X.9    X.10
#> 1                                  
#> 2           FEMALES                
#> 3       UCL     EST     LCL     UCL
#> 4    0.9168  0.8750  0.8457  0.9146
#> 5    0.1619  0.0982  0.0745  0.1308
#> 6    0.1767  0.0175  0.0000  0.0576
#> 7    0.0339  0.0000  0.0000  0.0131
#> 8                                  
#> 9                                  
#> 10          FEMALES                
#> 11      UCL     EST     LCL     UCL
#> 12  75.1989 70.7583 69.1446 72.9162
#> 13   0.0000  0.0000  0.0000  0.0000
#> 14   0.6260  0.5565  0.4248  0.6203
#> 15   0.3600  0.1875  0.1579  0.2791
#> 16   0.3283  0.2432  0.1366  0.3260
#> 17   0.1093  0.0182  0.0000  0.0591
#> 18   1.0000  0.0000  0.0000  0.0000
#> 19   0.0000  1.0000  1.0000  1.0000
#> 20   0.0813  0.0333  0.0125  0.0646
#> 21   0.6374  0.1565  0.0947  0.2198
#> 22   0.2600  0.0642  0.0349  0.1095
#> 23   0.1421  0.0351  0.0049  0.0698
#> 24   0.2644  0.6875  0.6095  0.7941
#> 25   0.0000  0.0000  0.0000  0.0000
#> 26   0.3096  0.1148  0.0620  0.2045
#> 27                                 
#> 28                                 
#> 29          FEMALES                
#> 30      UCL     EST     LCL     UCL
#> 31   2.6544  2.6396  2.4155  2.9008
#> 32   4.7217  4.7615  4.4840  4.8453
#> 33   0.9570  0.9273  0.8673  0.9463
#> 34   0.5648  0.5586  0.4875  0.6227
#> 35   0.6473  0.6036  0.4737  0.6720
#> 36   0.0501  0.0642  0.0248  0.1295
#> 37   0.1009  0.0367  0.0187  0.0445
#> 38   0.5071  0.2589  0.2214  0.3185
#> 39   0.5608  0.4732  0.3313  0.5218
#> 40   0.0300  0.0360  0.0035  0.0680
#> 41   0.2958  0.2589  0.2165  0.3072
#> 42   0.5182  0.5676  0.4666  0.6631
#> 43   1.0000  0.9652  0.9422  0.9817
#> 44                                 
#> 45                                 
#> 46          FEMALES                
#> 47      UCL     EST     LCL     UCL
#> 48   0.5841  0.5500  0.3802  0.5769
#> 49   0.5608  0.4732  0.3313  0.5218
#> 50   0.1191  0.1583  0.0867  0.2044
#> 51   0.6766  0.6696  0.5867  0.7444
#> 52   0.1009  0.0631  0.0442  0.1109
#> 53   0.6882  0.6875  0.5957  0.7724
#> 54   0.6791  0.6875  0.5629  0.7434
#> 55   0.0300  0.0360  0.0035  0.0680
#> 56   0.7505  0.5856  0.4704  0.6879
#> 57   0.7505  0.6757  0.5608  0.7284
#> 58   0.8665  0.8333  0.7528  0.8661
#> 59   0.7505  0.5856  0.4704  0.6879
#> 60   0.9336  0.8525  0.7843  0.8739
#> 61   0.5213  0.3304  0.2971  0.4239
#> 62   0.5213  0.3214  0.2940  0.3952
#> 63                                 
#> 64                                 
#> 65          FEMALES                
#> 66      UCL     EST     LCL     UCL
#> 67   0.8765  0.7857  0.7478  0.8424
#> 68   0.3586  0.1607  0.0929  0.1875
#> 69   0.0655  0.0250  0.0018  0.0431
#> 70                                 
#> 71                                 
#> 72          FEMALES                
#> 73      UCL     EST     LCL     UCL
#> 74   1.0000  1.0000  1.0000  1.0000
#> 75   0.0000  0.0000  0.0000  0.0000
#> 76   0.0000  0.0000  0.0000  0.0000
#> 77   0.0000  0.0000  0.0000  0.0000
#> 78   1.0000  1.0000  1.0000  1.0000
#> 79   0.0000  0.0000  0.0000  0.0000
#> 80   0.0000  0.0000  0.0000  0.0000
#> 81   0.0000  0.0000  0.0000  0.0000
#> 82   1.0000  1.0000  1.0000  1.0000
#> 83   0.0000  0.0000  0.0000  0.0000
#> 84   0.0000  0.0000  0.0000  0.0000
#> 85   0.0000  0.0000  0.0000  0.0000
#> 86   1.0000  1.0000  1.0000  1.0000
#> 87   0.0000  0.0000  0.0000  0.0000
#> 88   0.0000  0.0000  0.0000  0.0000
#> 89   0.0000  0.0000  0.0000  0.0000
#> 90   1.0000  1.0000  1.0000  1.0000
#> 91   0.0000  0.0000  0.0000  0.0000
#> 92   0.0000  0.0000  0.0000  0.0000
#> 93   0.0000  0.0000  0.0000  0.0000
#> 94   1.0000  1.0000  1.0000  1.0000
#> 95   0.0000  0.0000  0.0000  0.0000
#> 96   0.0000  0.0000  0.0000  0.0000
#> 97   0.0000  0.0000  0.0000  0.0000
#> 98   1.0000  1.0000  1.0000  1.0000
#> 99   0.0000  0.0000  0.0000  0.0000
#> 100  0.0000  0.0000  0.0000  0.0000
#> 101  0.0000  0.0000  0.0000  0.0000
#> 102  0.0000  0.0000  0.0000  0.0000
#> 103                                
#> 104                                
#> 105         FEMALES                
#> 106     UCL     EST     LCL     UCL
#> 107  0.9831  0.9910  0.9637  1.0000
#> 108  1.0000  1.0000  0.9913  1.0000
#> 109  1.0000  1.0000  0.9913  1.0000
#> 110  0.9976  0.9554  0.9433  0.9967
#> 111  0.8489  0.7391  0.6420  0.7634
#> 112  1.0000  1.0000  1.0000  1.0000
#> 113  5.7790  5.6757  5.5930  5.7380
#> 114  1.0000  0.9910  0.9634  1.0000
#> 115  0.0000  0.0090  0.0000  0.0366
#> 116  0.1106  0.0000  0.0000  0.0000
#> 117  0.6580  0.6161  0.5126  0.6883
#> 118  0.1944  0.0833  0.0787  0.1287
#> 119                                
#> 120                                
#> 121         FEMALES                
#> 122     UCL     EST     LCL     UCL
#> 123 14.9531 12.8739 11.6603 13.8111
#> 124  0.7060  0.5135  0.4841  0.6132
#> 125  0.3179  0.2162  0.1665  0.2784
#> 126                                
#> 127                                
#> 128         FEMALES                
#> 129     UCL     EST     LCL     UCL
#> 130  0.5133  0.5045  0.4481  0.5396
#> 131  0.8229  0.8214  0.7387  0.9537
#> 132  0.5364  0.1000  0.0000  0.4667
#> 133  0.4262  0.3636  0.0600  0.6258
#> 134  0.0000  0.1818  0.0167  0.3067
#> 135  0.4667  0.0000  0.0000  0.0000
#> 136  0.0000  0.0000  0.0000  0.0000
#> 137  0.0000  0.0000  0.0000  0.0000
#> 138  0.0000  0.0000  0.0000  0.3600
#> 139  0.0000  0.0000  0.0000  0.0000
#> 140  0.3238  0.1667  0.0000  0.5709
#> 141  0.9222  0.8624  0.8040  0.9238
#> 142  0.9077  0.8830  0.7730  0.9273
#> 143  0.4219  0.1176  0.0000  0.1715
#> 144  0.8250  0.8000  0.4701  1.0000
#> 145  0.0000  0.0000  0.0000  0.0000
#> 146  0.2536  0.0000  0.0000  0.0000
#> 147  0.0000  0.0000  0.0000  0.0000
#> 148  0.0000  0.1000  0.0000  0.4935
#> 149  0.0000  0.0000  0.0000  0.0000
#> 150  0.0000  0.0000  0.0000  0.0400
#> 151  0.0000  0.0000  0.0000  0.0000
#> 152  0.0479  0.0348  0.0195  0.1095
#> 153  0.6142  0.3514  0.2378  0.4278
#> 154  0.3367  0.3167  0.2623  0.4098
#> 155                                
#> 156                                
#> 157         FEMALES                
#> 158     UCL     EST     LCL     UCL
#> 159  0.7400  0.5351  0.4752  0.6011
#> 160  0.5448  0.3028  0.2376  0.3968
#> 161  0.3080  0.0357  0.0271  0.0602
#> 162  0.0755  0.0091  0.0000  0.0505
#> 163  0.0386  0.0721  0.0473  0.0986
#> 164  0.0000  0.0182  0.0103  0.0423
#> 165  0.0500  0.0000  0.0000  0.0000
#> 166  0.0576  0.0000  0.0000  0.0482
#> 167  0.4150  0.3391  0.2793  0.4338
#> 168  0.0249  0.0000  0.0000  0.0471
#> 169                                
#> 170                                
#> 171         FEMALES                
#> 172     UCL     EST     LCL     UCL
#> 173  0.6760  0.6435  0.5796  0.7328
#> 174  0.7147  0.7391  0.6979  0.8275
#> 175  0.3122  0.2523  0.1492  0.2788
#> 176  0.3122  0.2377  0.1422  0.2667
#> 177                                
#> 178                                
#> 179         FEMALES                
#> 180     UCL     EST     LCL     UCL
#> 181  0.0665  0.0351  0.0037  0.0739
#> 182  0.0870  0.0446  0.0055  0.0794
#> 183  0.0738  0.0182  0.0018  0.0432
#> 184                                
#> 185                                
#> 186         FEMALES                
#> 187     UCL     EST     LCL     UCL
#> 188  0.0261  0.0471  0.0210  0.0586
#> 189  0.0261  0.0467  0.0135  0.0554
#> 190  0.0016  0.0005  0.0000  0.0091

The RAM-OP workflow in R using pipe operators

The oldr package functions were designed in such a way that they can be piped to each other to provide the desired output. Below we use the base R pipe operator |>.

Piped operation to get output estimates table

testSVY |>
  create_op() |>
  estimate_op(w = testPSU, replicates = 9) |>
  report_op_table(filename = file.path(tempdir(), "TEST"))

This results in a CSV file TEST.report.csv in the temporary directory

file.exists(file.path(tempdir(), "TEST.report.csv"))
#> [1] TRUE

with the following structure:

#>                              X  X.1      X.2      X.3      X.4      X.5
#> 1                       Survey                                         
#> 2                                        ALL                      MALES
#> 3                    INDICATOR TYPE      EST      LCL      UCL      EST
#> 4                           99    2  84.3750  81.8750  86.3542  84.2105
#> 5                           96    2   9.3750   8.0208  12.8125   6.5789
#> 6                           98    2   3.6458   2.7083   6.1458   4.4944
#> 7                           97    2   1.0417   0.1042   3.1250   3.0303
#> 8                                                                      
#> 9     Demography and situation                                         
#> 10                                       ALL                      MALES
#> 11                   INDICATOR TYPE      EST      LCL      UCL      EST
#> 12                          54    1  71.0104  70.1094  72.0312  71.0886
#> 13                         106    2   0.0000   0.0000   0.0000   0.0000
#> 14                         107    2  54.1667  47.1875  58.7500  51.5152
#> 15                         108    2  23.4375  16.1458  30.0000  28.1690
#> 16                         109    2  17.7083  13.3333  23.7500  17.1053
#> 17                         105    2   5.7292   4.6875   8.7500   3.7975
#> 18                         115    2  39.0625  31.5625  48.9583 100.0000
#> 19                         114    2  60.9375  51.0417  68.4375   0.0000
#> 20                          51    2   3.6458   1.6667   4.5833   1.3158
#> 21                          49    2  32.8125  21.1458  37.6042  51.8987
#> 22                          48    2  10.4167   8.3333  12.9167  19.7368
#> 23                          47    2   7.8125   4.8958   8.3333   9.0909
#> 24                          52    2  47.3958  41.6667  55.4167  21.2121
#> 25                          50    2   0.0000   0.0000   0.0000   0.0000
#> 26                         127    2  13.0208   8.4375  20.1042  13.1579
#> 27                                                                     
#> 28                        Diet                                         
#> 29                                       ALL                      MALES
#> 30                   INDICATOR TYPE      EST      LCL      UCL      EST
#> 31                          53    1   2.5573   2.4792   2.8042   2.5493
#> 32                          25    1   4.5781   4.3948   4.9073   4.5263
#> 33                          14    2  92.1875  88.6458  93.6458  90.1408
#> 34                          23    2  53.6458  47.2917  63.6458  41.7722
#> 35                          18    2  59.8958  51.6667  68.3333  58.2278
#> 36                          20    2   6.7708   3.8542  10.4167   4.5455
#> 37                          15    2   3.1250   1.7708   8.2292   5.1948
#> 38                          17    2  36.9792  24.8958  41.3542  42.1053
#> 39                          19    2  42.1875  38.1250  47.3958  39.2405
#> 40                          21    2   3.1250   0.3125   5.0000   0.0000
#> 41                          16    2  22.3958  15.7292  27.2917  22.7848
#> 42                          24    2  50.0000  37.1875  56.0417  45.4545
#> 43                          22    2  96.3542  94.4792  99.8958  97.3684
#> 44                                                                     
#> 45                   Nutrients                                         
#> 46                                       ALL                      MALES
#> 47                   INDICATOR TYPE      EST      LCL      UCL      EST
#> 48                          88    2  48.9583  44.5833  54.4792  46.4789
#> 49                          89    2  42.1875  38.1250  47.3958  39.2405
#> 50                          87    2  12.5000   9.4792  21.5625   9.2105
#> 51                          83    2  63.0208  54.1667  73.1250  54.4304
#> 52                           2    2   6.2500   4.2708  11.4583   6.7416
#> 53                           3    2  65.6250  56.6667  76.5625  60.5263
#> 54                          42    2  67.1875  61.3542  76.8750  60.7595
#> 55                           9    2   3.1250   0.3125   5.0000   0.0000
#> 56                         140    2  64.0625  51.0417  70.4167  63.6364
#> 57                         135    2  69.7917  56.5625  73.4375  67.1053
#> 58                         137    2  83.3333  78.4375  87.2917  75.2809
#> 59                         138    2  64.0625  51.0417  70.4167  63.6364
#> 60                         139    2  87.5000  83.1250  91.0417  86.8421
#> 61                         136    2  42.7083  29.7917  47.0833  48.1013
#> 62                         134    2  41.6667  28.9583  45.1042  44.7368
#> 63                                                                     
#> 64               Food Security                                         
#> 65                                       ALL                      MALES
#> 66                   INDICATOR TYPE      EST      LCL      UCL      EST
#> 67                          45    2  76.5625  73.1250  80.0000  78.4810
#> 68                          60    2  19.2708  14.8958  22.2917  20.2532
#> 69                         113    2   1.5625   1.0417   4.0625   1.3158
#> 70                                                                     
#> 71             Disability (WG)                                         
#> 72                                       ALL                      MALES
#> 73                   INDICATOR TYPE      EST      LCL      UCL      EST
#> 74                         129    2 100.0000 100.0000 100.0000 100.0000
#> 75                         130    2   0.0000   0.0000   0.0000   0.0000
#> 76                         131    2   0.0000   0.0000   0.0000   0.0000
#> 77                         132    2   0.0000   0.0000   0.0000   0.0000
#> 78                          28    2 100.0000 100.0000 100.0000 100.0000
#> 79                          29    2   0.0000   0.0000   0.0000   0.0000
#> 80                          30    2   0.0000   0.0000   0.0000   0.0000
#> 81                          31    2   0.0000   0.0000   0.0000   0.0000
#> 82                          55    2 100.0000 100.0000 100.0000 100.0000
#> 83                          56    2   0.0000   0.0000   0.0000   0.0000
#> 84                          57    2   0.0000   0.0000   0.0000   0.0000
#> 85                          58    2   0.0000   0.0000   0.0000   0.0000
#> 86                          92    2 100.0000 100.0000 100.0000 100.0000
#> 87                          93    2   0.0000   0.0000   0.0000   0.0000
#> 88                          94    2   0.0000   0.0000   0.0000   0.0000
#> 89                          95    2   0.0000   0.0000   0.0000   0.0000
#> 90                         101    2 100.0000 100.0000 100.0000 100.0000
#> 91                         102    2   0.0000   0.0000   0.0000   0.0000
#> 92                         103    2   0.0000   0.0000   0.0000   0.0000
#> 93                         104    2   0.0000   0.0000   0.0000   0.0000
#> 94                          10    2 100.0000 100.0000 100.0000 100.0000
#> 95                          11    2   0.0000   0.0000   0.0000   0.0000
#> 96                          12    2   0.0000   0.0000   0.0000   0.0000
#> 97                          13    2   0.0000   0.0000   0.0000   0.0000
#> 98                          63    2 100.0000 100.0000 100.0000 100.0000
#> 99                           5    2   0.0000   0.0000   0.0000   0.0000
#> 100                          6    2   0.0000   0.0000   0.0000   0.0000
#> 101                          7    2   0.0000   0.0000   0.0000   0.0000
#> 102                         62    2   0.0000   0.0000   0.0000   0.0000
#> 103                                                                    
#> 104 Activities of daily living                                         
#> 105                                      ALL                      MALES
#> 106                  INDICATOR TYPE      EST      LCL      UCL      EST
#> 107                         35    2  96.3542  94.0625  97.9167  97.3684
#> 108                         37    2  98.4375  96.9792  99.4792  97.4684
#> 109                         39    2  98.4375  96.9792  99.4792  97.4684
#> 110                         40    2  95.3125  92.8125  98.7500  97.3684
#> 111                         36    2  73.9583  66.6667  76.9792  78.4810
#> 112                         38    2 100.0000  98.2292 100.0000  98.6842
#> 113                         44    1   5.6250   5.5552   5.6865   5.6579
#> 114                         41    2  97.3958  95.5208  98.4375  97.4684
#> 115                         82    2   1.5625   0.0000   4.2708   0.0000
#> 116                        112    2   1.0417   0.1042   2.8125   2.5316
#> 117                        126    2  57.8125  51.8750  72.1875  57.1429
#> 118                        125    2  10.4167   5.6250  15.9375  13.9241
#> 119                                                                    
#> 120              Mental health                                         
#> 121                                      ALL                      MALES
#> 122                  INDICATOR TYPE      EST      LCL      UCL      EST
#> 123                         43    1  11.8906  10.6073  12.9615  11.0423
#> 124                        110    2  45.8333  37.2917  56.0417  45.0704
#> 125                         85    2  22.3958  14.4792  28.5417  24.7191
#> 126                                                                    
#> 127                     Health                                         
#> 128                                      ALL                      MALES
#> 129                  INDICATOR TYPE      EST      LCL      UCL      EST
#> 130                         46    2  43.7500  39.4792  52.0833  36.8421
#> 131                        128    2  75.0000  63.9572  90.4000  73.5294
#> 132                         74    2  12.5000   0.0000  50.0621  10.0000
#> 133                         79    2  36.3636  23.1111  69.4639  33.3333
#> 134                         80    2   6.6667   0.0000  23.6364   0.0000
#> 135                         81    2  14.2857   0.5128  24.9697  22.2222
#> 136                         73    2   0.0000   0.0000   0.0000   0.0000
#> 137                         77    2   0.0000   0.0000   0.0000   0.0000
#> 138                         75    2   0.0000   0.0000  15.1515   0.0000
#> 139                         78    2   0.0000   0.0000   0.0000   0.0000
#> 140                         76    2  15.3846   0.0000  42.7826  20.0000
#> 141                         91    2  85.4167  80.8333  89.1667  80.3030
#> 142                          1    2  82.6923  75.1163  85.6149  75.4386
#> 143                         65    2   7.1429   0.0000  17.7455   7.1429
#> 144                         70    2  84.0000  61.6364  93.7402  83.3333
#> 145                         71    2   0.0000   0.0000   0.0000   0.0000
#> 146                         72    2   4.0000   0.0000  11.8222   5.8824
#> 147                         64    2   0.0000   0.0000   0.0000   0.0000
#> 148                         68    2   2.7027   0.0000  18.7273   0.0000
#> 149                         66    2   0.0000   0.0000   0.0000   0.0000
#> 150                         69    2   0.0000   0.0000   3.9407   0.0000
#> 151                         67    2   0.0000   0.0000   0.0000   0.0000
#> 152                          8    2   2.6042   0.6250   4.6875   1.1236
#> 153                        133    2  44.7917  34.2708  49.7917  51.8987
#> 154                         86    2  30.7292  24.5833  33.6458  22.7848
#> 155                                                                    
#> 156                     Income                                         
#> 157                                      ALL                      MALES
#> 158                  INDICATOR TYPE      EST      LCL      UCL      EST
#> 159                         27    2  57.2917  51.3542  69.6875  59.2105
#> 160                        116    2  39.5833  30.9375  48.2292  43.4211
#> 161                        124    2  11.9792   6.0417  16.5625  21.3483
#> 162                        121    2   3.1250   1.1458   8.0208   6.3291
#> 163                        123    2   5.7292   3.2292  10.0000   2.6316
#> 164                        119    2   0.0000   0.0000   3.2292   0.0000
#> 165                        122    2   1.0417   0.0000   3.0208   1.2987
#> 166                        118    2   2.0833   1.0417   5.6250   3.7975
#> 167                        117    2  32.8125  30.4167  35.8333  25.0000
#> 168                        120    2   0.5208   0.1042   1.5625   0.0000
#> 169                                                                    
#> 170                       WASH                                         
#> 171                                      ALL                      MALES
#> 172                  INDICATOR TYPE      EST      LCL      UCL      EST
#> 173                         34    2  60.9375  57.6042  65.5208  56.3380
#> 174                        100    2  72.9167  64.2708  77.2917  60.5263
#> 175                         33    2  24.4792  19.3750  29.2708  31.1688
#> 176                         32    2  23.9583  17.5000  29.1667  29.5775
#> 177                                                                    
#> 178                     Relief                                         
#> 179                                      ALL                      MALES
#> 180                  INDICATOR TYPE      EST      LCL      UCL      EST
#> 181                         84    2   3.6458   2.6042   7.7083   2.6316
#> 182                          4    2   4.1667   1.9792   7.7083   5.2632
#> 183                         90    2   2.6042   1.5625   3.6458   2.5974
#> 184                                                                    
#> 185              Anthropometry                                         
#> 186                                      ALL                      MALES
#> 187                  INDICATOR TYPE      EST      LCL      UCL      EST
#> 188                         26    2   2.6577   1.0365   3.9335   0.8760
#> 189                         59    2   2.5939   0.9551   3.7951   0.8760
#> 190                        111    2   0.0892   0.0000   0.2192   0.0000
#>          X.6      X.7      X.8      X.9     X.10
#> 1                                               
#> 2                      FEMALES                  
#> 3        LCL      UCL      EST      LCL      UCL
#> 4    78.3971  87.5807  85.2174  82.7586  90.8084
#> 5     4.6082  10.9560  11.6071   8.8638  15.8385
#> 6     2.7848   9.8006   1.7857   0.0000   5.5232
#> 7     1.6331   5.2632   0.0000   0.0000   0.8929
#> 8                                               
#> 9                                               
#> 10                     FEMALES                  
#> 11       LCL      UCL      EST      LCL      UCL
#> 12   68.7156  72.4660  71.0179  68.8629  72.3244
#> 13    0.0000   0.0000   0.0000   0.0000   0.0000
#> 14   42.2235  62.0483  54.7009  43.4313  61.1394
#> 15   19.9453  38.5659  20.6897  11.8501  27.9310
#> 16    4.7927  25.7729  20.6897  18.2434  30.6897
#> 17    1.4884  11.2759   2.6786   0.0000   8.0678
#> 18  100.0000 100.0000   0.0000   0.0000   0.0000
#> 19    0.0000   0.0000 100.0000 100.0000 100.0000
#> 20    0.0000   4.3747   4.3103   1.7365   6.9445
#> 21   42.8415  59.3071  15.6522   6.9704  20.9360
#> 22    5.2153  27.6673   5.1724   2.1735   8.3893
#> 23    1.5760  24.3207   4.3103   1.2500  11.9520
#> 24   11.3264  24.5570  69.8276  62.6987  74.9180
#> 25    0.0000   0.0000   0.0000   0.0000   0.0000
#> 26    6.2792  21.2714  12.9310   6.5385  13.7131
#> 27                                              
#> 28                                              
#> 29                     FEMALES                  
#> 30       LCL      UCL      EST      LCL      UCL
#> 31    2.3682   2.7291   2.6518   2.4628   2.7316
#> 32    4.2855   4.9194   4.6552   4.5433   4.9095
#> 33   86.5593  96.0526  92.8571  85.8128  95.5467
#> 34   38.0172  63.3333  55.3571  48.0165  61.1946
#> 35   46.9805  71.2310  58.2609  51.9150  71.3737
#> 36    0.2532   7.6316   6.8376   2.1429  11.4432
#> 37    2.6316  12.2621   1.7094   0.0000   4.0932
#> 38   35.1572  59.1707  30.1724  26.0345  36.3458
#> 39   28.6691  44.7368  42.8571  36.8919  46.5271
#> 40    0.0000   6.1722   2.6786   1.6593   4.9954
#> 41   20.2051  28.1532  20.5357  12.7031  27.7722
#> 42   31.6722  53.1540  54.0984  48.2143  68.9655
#> 43   93.7246 100.0000  98.2143  93.5961 100.0000
#> 44                                              
#> 45                                              
#> 46                     FEMALES                  
#> 47       LCL      UCL      EST      LCL      UCL
#> 48   33.6624  51.3158  49.1379  41.6901  52.4707
#> 49   28.6691  44.7368  42.8571  36.8919  46.5271
#> 50    5.6091  19.7140  10.3448   6.5517  16.1505
#> 51   49.8137  71.9846  60.0000  54.5055  72.6710
#> 52    2.8648  14.9381   4.4643   3.4483   7.0818
#> 53   54.2853  74.9076  62.6087  58.0357  75.5111
#> 54   53.2998  71.0542  69.2308  64.4643  81.4019
#> 55    0.0000   6.1722   2.6786   1.6593   4.9954
#> 56   55.2595  84.5136  58.9286  56.5967  62.5608
#> 57   61.2392  84.7334  62.5000  58.8966  68.0130
#> 58   69.9067  87.4861  86.3248  79.6429  89.9883
#> 59   55.2595  84.5136  58.9286  56.5967  62.5608
#> 60   78.7342  93.9778  88.7931  80.0000  90.8899
#> 61   38.8939  68.5616  37.3913  29.5443  43.4456
#> 62   38.2989  68.5616  36.5217  29.3658  42.1325
#> 63                                              
#> 64                                              
#> 65                     FEMALES                  
#> 66       LCL      UCL      EST      LCL      UCL
#> 67   60.2632  83.8338  80.3279  74.6176  84.7537
#> 68   13.1711  34.2105  13.3929   8.1034  21.8476
#> 69    0.2247   6.9496   2.5862   0.0000   5.8208
#> 70                                              
#> 71                                              
#> 72                     FEMALES                  
#> 73       LCL      UCL      EST      LCL      UCL
#> 74  100.0000 100.0000 100.0000 100.0000 100.0000
#> 75    0.0000   0.0000   0.0000   0.0000   0.0000
#> 76    0.0000   0.0000   0.0000   0.0000   0.0000
#> 77    0.0000   0.0000   0.0000   0.0000   0.0000
#> 78  100.0000 100.0000 100.0000 100.0000 100.0000
#> 79    0.0000   0.0000   0.0000   0.0000   0.0000
#> 80    0.0000   0.0000   0.0000   0.0000   0.0000
#> 81    0.0000   0.0000   0.0000   0.0000   0.0000
#> 82  100.0000 100.0000 100.0000 100.0000 100.0000
#> 83    0.0000   0.0000   0.0000   0.0000   0.0000
#> 84    0.0000   0.0000   0.0000   0.0000   0.0000
#> 85    0.0000   0.0000   0.0000   0.0000   0.0000
#> 86  100.0000 100.0000 100.0000 100.0000 100.0000
#> 87    0.0000   0.0000   0.0000   0.0000   0.0000
#> 88    0.0000   0.0000   0.0000   0.0000   0.0000
#> 89    0.0000   0.0000   0.0000   0.0000   0.0000
#> 90  100.0000 100.0000 100.0000 100.0000 100.0000
#> 91    0.0000   0.0000   0.0000   0.0000   0.0000
#> 92    0.0000   0.0000   0.0000   0.0000   0.0000
#> 93    0.0000   0.0000   0.0000   0.0000   0.0000
#> 94  100.0000 100.0000 100.0000 100.0000 100.0000
#> 95    0.0000   0.0000   0.0000   0.0000   0.0000
#> 96    0.0000   0.0000   0.0000   0.0000   0.0000
#> 97    0.0000   0.0000   0.0000   0.0000   0.0000
#> 98  100.0000 100.0000 100.0000 100.0000 100.0000
#> 99    0.0000   0.0000   0.0000   0.0000   0.0000
#> 100   0.0000   0.0000   0.0000   0.0000   0.0000
#> 101   0.0000   0.0000   0.0000   0.0000   0.0000
#> 102   0.0000   0.0000   0.0000   0.0000   0.0000
#> 103                                             
#> 104                                             
#> 105                    FEMALES                  
#> 106      LCL      UCL      EST      LCL      UCL
#> 107  88.7081  98.7981  97.3913  94.5170 100.0000
#> 108  93.4381  99.7753 100.0000  97.6756 100.0000
#> 109  93.4381  99.7753 100.0000  97.6756 100.0000
#> 110  92.1258  98.7981  95.6897  88.7500  99.6581
#> 111  68.5149  89.9518  68.7500  59.8276  74.1549
#> 112  94.7505 100.0000 100.0000 100.0000 100.0000
#> 113   5.4375   5.8497   5.6087   5.4768   5.6832
#> 114  93.4381  99.7753  95.6897  91.4286 100.0000
#> 115   0.0000   0.0000   4.3103   0.0000   8.5714
#> 116   0.2247   6.5619   0.0000   0.0000   0.0000
#> 117  47.8054  70.2871  63.3929  54.8606  71.9906
#> 118   6.0528  22.4532   8.0357   5.9932  15.0165
#> 119                                             
#> 120                                             
#> 121                    FEMALES                  
#> 122      LCL      UCL      EST      LCL      UCL
#> 123   9.8605  12.7229  12.5086  11.9506  13.4978
#> 124  30.8214  55.1899  49.5726  43.5326  58.1773
#> 125   4.6769  31.3700  20.4918  16.5817  30.9829
#> 126                                             
#> 127                                             
#> 128                    FEMALES                  
#> 129      LCL      UCL      EST      LCL      UCL
#> 130  27.8628  51.0965  44.4444  38.0211  55.1724
#> 131  56.4667  80.0952  80.3571  76.2542  89.3939
#> 132   0.0000  52.9870   8.3333   0.0000  26.2626
#> 133   0.0000  58.9091  58.3333  35.7576 100.0000
#> 134   0.0000   0.0000  11.1111   0.0000  33.3333
#> 135   2.2222  79.0000   0.0000   0.0000   0.0000
#> 136   0.0000   0.0000   0.0000   0.0000   0.0000
#> 137   0.0000   0.0000   0.0000   0.0000   0.0000
#> 138   0.0000   0.0000   0.0000   0.0000   7.2727
#> 139   0.0000   0.0000   0.0000   0.0000   0.0000
#> 140   1.3333  41.5556   0.0000   0.0000  31.6667
#> 141  73.4450  90.6329  88.3929  83.6094  95.9463
#> 142  71.1671  82.5357  86.3636  80.3962  93.5294
#> 143   0.0000  24.2105   5.2632   0.0000  30.4167
#> 144  49.5614 100.0000  76.9231  55.4386 100.0000
#> 145   0.0000   0.0000   0.0000   0.0000   0.0000
#> 146   0.0000  28.5965   0.0000   0.0000   0.0000
#> 147   0.0000   0.0000   0.0000   0.0000   0.0000
#> 148   0.0000   0.0000   5.0000   0.0000  21.7949
#> 149   0.0000   0.0000   0.0000   0.0000   0.0000
#> 150   0.0000   0.0000   0.0000   0.0000  22.3026
#> 151   0.0000   0.0000   0.0000   0.0000   0.0000
#> 152   0.0000   2.6116   1.7857   0.8562   6.2894
#> 153  36.4593  59.8431  37.3913  30.2918  43.6241
#> 154  15.6254  33.0993  30.3571  25.2174  44.4091
#> 155                                             
#> 156                                             
#> 157                    FEMALES                  
#> 158      LCL      UCL      EST      LCL      UCL
#> 159  47.3475  66.3603  52.1368  42.3645  59.8966
#> 160  33.6730  51.5190  31.2500  23.9729  39.3770
#> 161  17.5571  34.9137   6.8966   1.5825  11.9805
#> 162   0.3030   6.7090   0.8197   0.0000   3.8054
#> 163   0.0000   6.6054  11.3043   6.3660  15.2709
#> 164   0.0000   0.0000   0.0000   0.0000   1.7705
#> 165   0.0000   6.0759   0.0000   0.0000   0.0000
#> 166   0.0000   8.0764   1.6393   0.0000   3.5468
#> 167  22.5345  34.0760  38.5246  30.6650  42.8588
#> 168   0.0000   3.3011   0.0000   0.0000   2.3991
#> 169                                             
#> 170                                             
#> 171                    FEMALES                  
#> 172      LCL      UCL      EST      LCL      UCL
#> 173  52.6671  67.4778  60.0000  56.0776  72.6786
#> 174  56.7748  76.3477  72.3214  66.7365  82.3064
#> 175  20.3682  33.6576  20.8696  14.8998  26.1622
#> 176  20.0000  33.6576  20.8696  13.5323  25.9836
#> 177                                             
#> 178                                             
#> 179                    FEMALES                  
#> 180      LCL      UCL      EST      LCL      UCL
#> 181   0.0000   7.6145   2.6786   1.0468   7.4243
#> 182   0.2532  11.9505   4.3478   1.9414   7.9310
#> 183   0.2532   4.3550   1.7094   0.0000   4.8276
#> 184                                             
#> 185                                             
#> 186                    FEMALES                  
#> 187      LCL      UCL      EST      LCL      UCL
#> 188   0.1101   1.4847   3.4169   1.4613   8.9322
#> 189   0.1101   1.4754   3.0045   1.3700   8.1392
#> 190   0.0000   0.0093   0.1417   0.0059   0.9586

Piped operation to get output an HTML report

If the preferred output is a report with combined charts and tables of results, the following piped operations can be performed:

testSVY |>
  create_op() |>
  estimate_op(w = testPSU, replicates = 9) |>
  report_op_html(
    svy = testSVY, filename = file.path(tempdir(), "ramOPreport")
  )

which results in an HTML file saved in the specified output directory that looks something like this:

Example of a RAM-OP HTML report