AngusMcLure / PoolPoweR

Power and sample size calculations for surveys using pool testing (AKA group testing)
GNU General Public License v3.0
0 stars 1 forks source link

Add method dispatch for `optimise_results` class #44

Open fredjaya opened 4 months ago

fredjaya commented 4 months ago

Related to the pipeline of sample_design -> optimise_prevalence -> calculating pool_power or sample_size.

When an object of class sample_design has any NULL pool_size or pool_number, optimise_prevalence(x = sample_design, ...) needs to be run to infer them.

Method dispatches exist for sample_design and will only work when pool_size or pool_number are not NULL.

Method dispatches required for optimise_results in the case where sample_design have NULLs.

Steps to reproduce:

fd <- fixed_design()
opt <- optimise_prevalence(fd, correlation = 0.01, cost_unit = 1, cost_pool = 4, cost_cluster = 10, prevalence = 0.005)
pool_power(opt) # or sample_size(opt)