Closed fredjaya closed 3 weeks ago
I've had a look and think I fixed up the roxygen issue that was preventing the print method from registering properly. I also fixed the issues with pool_strat method documentation while I was at it.
Also responses to your questions:
This is potentially quite a lot of results to display, but I think it makes sense to display these.
One bridge to cross is how to display the pool_strat function in a pretty way. I've created a as.character method for it which just return the call as a character, but this might not be an ideal way to represent it.
Happy to discuss more if there are issues/questions
Example print output as discussed:
DIAGNOSTIC TEST
sensitivity =
specificity =
PREVALENCE
prev_alt =
prev_null =
correlation =
STATISTICAL TEST
sig_level =
power =
alternative =
SAMPLE DESIGN
pool size =
pool num =
clusters =
total units =
total pools =
Placeholder sentence with the inferred value (e.g. power) and some prose
pool strat and pool catch when using *_random()
Just noting that we want to make sure that the output/input names match the output/input names in the pretty print layout. Specifically I am thinking about the _ that are present/absent in some of the above names?
Agree! This is what it looks like for power_pool()
at the moment:
DIAGNOSTIC TEST
sensitivity = 1
specificity = 1
PREVALENCE
prev_null = 0.01
prev_alt = 0.02
correlation = 0
STATISTICAL TEST
sig_level = 0.05
power = 0.761791072653377
alternative = greater
SAMPLE DESIGN
pool_size = 10
pool_number = 2
cluster_number = 50
total_pools = 100
total_units = 1000
A perfect diagnostic test with the above parameters has a power of 0.761791072653377
And for an imperfect test:
DIAGNOSTIC TEST
sensitivity = 0.99
specificity = 0.98
PREVALENCE
prev_null = 0.01
prev_alt = 0.02
correlation = 0
STATISTICAL TEST
sig_level = 0.05
power = 0.669690930981782
alternative = greater
SAMPLE DESIGN
pool_size = 10
pool_number = 2
cluster_number = 50
total_pools = 100
total_units = 1000
An imperfect diagnostic test with the above parameters has a power of 0.669690930981782
Any suggestions/changes before I push?
Looks great.
Two suggestions:
My guess is that we'll have to iterate on what goes into the summary sentences as we look at the different functions!
Agree with the rounding when printing! Would still like to keep "imperfect diagnostic test" for clarity
Hey @AngusMcLure, I have just pushed a draft of what an output class for
power_pool()
could look like, based on the pretty print forstats::power.prop.test
.Need to fix the way pretty print is triggered (e.g. instead of str()), but this is the current command to get the output below
Could you indicate/suggest:
sample_size_pool
has total pools)