Function to apply bootstrap to RAM-OP indicators using a PROBIT estimator.
Source:R/06-probitBoot.R
estimate_probit.Rd
Function to apply bootstrap to RAM-OP indicators using a PROBIT estimator.
Usage
estimate_probit(
x,
w,
gam.stat = probit_gam,
sam.stat = probit_sam,
params = "MUAC",
outputColumns = "MUAC",
replicates = 399
)
Arguments
- x
Indicators dataset produced by create_op_all with primary sampling unit (PSU) in column named
PSU
- w
A data frame with primary sampling unit (PSU) in column named
psu
and survey weight (i.e. PSU population) in column namedpop
- gam.stat
A function operating on data in
x
to estimate GAM prevalence for older people. Fixed toprobit_gam
- sam.stat
A function operating on data in
x
to estimate SAM prevalence for older people. Fixed toprobit_sam
- params
Parameters (named columns in
x
) passed to the function specified instatistic
; fixed toMUAC
as indicator amenable to probit estimation- outputColumns
Names of columns in output data frame; fixed to
MUAC
- replicates
Number of bootstrap replicate case and non-case
Examples
#
test <- estimate_probit(x = indicators.ALL,
w = testPSU,
replicates = 3)
test
#> # 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.0232 0.0140 4.13e-2 0.00814 3.31e-3 0.0166 0.0202
#> 2 MAM 0.0222 0.0134 4.13e-2 0.00814 3.13e-3 0.0166 0.0196
#> 3 SAM 0.000536 0.0000272 9.55e-4 0.0000356 1.78e-6 0.000184 0.000625
#> # ℹ 2 more variables: LCL.FEMALES <dbl>, UCL.FEMALES <dbl>