Function to increase or decrease the precision constraints in order to obtain the desired sample size

adjust_CVs(target_size, strata, errors, adj_rate = 0.01)

Arguments

target_size

desired sample size.

strata

the 'strata' dataset.

errors

the 'errors' dataset containing the current precision constraints

adj_rate

the rate of adjustment (default=0.01): the smaller, the higher the precision in reaching the target size; the higher, the quicker is the adjustment

Value

the new 'errors' dataset containing the modified precision constraints

Examples

data(beat.example)
errors
#>    DOM  CV1  CV2
#> 1 DOM1 0.10 0.99
#> 2 DOM2 0.99 0.99
a <- beat.1st(strata,errors)
sum(a$alloc$ALLOC[-nrow(a$alloc)])
#> [1] 6858
errors_new <- adjust_CVs(9000,strata,errors,adj_rate=0.005)
#> 
#>  Size:  6926
#>  Size:  6997
#>  Size:  7065
#>  Size:  7138
#>  Size:  7210
#>  Size:  7282
#>  Size:  7356
#>  Size:  7429
#>  Size:  7506
#>  Size:  7577
#>  Size:  7655
#>  Size:  7732
#>  Size:  7811
#>  Size:  7887
#>  Size:  7969
#>  Size:  8049
#>  Size:  8131
#>  Size:  8212
#>  Size:  8295
#>  Size:  8375
#>  Size:  8462
#>  Size:  8545
#>  Size:  8633
#>  Size:  8717
#>  Size:  8807
#>  Size:  8896
#>  Size:  8986
#>  Size:  9075
#>  Size:  9075
errors_new
#>    DOM       CV1       CV2
#> 1 DOM1 0.0869053 0.8603625
#> 2 DOM2 0.8603625 0.8603625