+ - 0:00:00
Notes for current slide
Notes for next slide

Introducing precisely

an R package for estimating sample size based on precision rather than power

1 / 39
2 / 39

precisely lets you estimate sample size based on precision instead of significance

3 / 39

precisely lets you estimate sample size based on precision instead of significance

calculate n for common measures, like risk difference and risk ratio

4 / 39

precisely lets you estimate sample size based on precision instead of significance

calculate n for common measures, like risk difference and risk ratio

Work in R or on the web

5 / 39
6 / 39
7 / 39

What is precision?

8 / 39

What is precision?

Differences: width of the CI

9 / 39

What is precision?

Differences: width of the CI

Ratios: upper bound/lower bound

10 / 39

You need:

desired precision

11 / 39

You need:

desired precision

proportions exposed/unexposed

12 / 39

You need:

desired precision

proportions exposed/unexposed

group ratio

13 / 39

You need:

desired precision

proportions exposed/unexposed

group ratio

coverage

14 / 39

the precisely R package

🎯 Calculate sample size for precision

15 / 39

the precisely R package

🎯 Calculate sample size for precision





install from GitHub:

remotes::install_github("malcolmbarrett/precisely")

15 / 39

Estimating n for risk difference

library(precisely)
n_risk_difference(
)
16 / 39

Estimating n for risk difference

library(precisely)
n_risk_difference(
precision = .08,
)
17 / 39

Estimating n for risk difference

library(precisely)
n_risk_difference(
precision = .08,
exposed = .4,
unexposed = .3,
)
18 / 39

Estimating n for risk difference

library(precisely)
n_risk_difference(
precision = .08,
exposed = .4,
unexposed = .3,
group_ratio = 3,
)
19 / 39

Estimating n for risk difference

library(precisely)
n_risk_difference(
precision = .08,
exposed = .4,
unexposed = .3,
group_ratio = 3,
ci = .90
)
20 / 39

Estimating n for risk difference

library(precisely)
n_risk_difference(
precision = .08,
exposed = .4,
unexposed = .3,
group_ratio = 3,
ci = .90
)
## # A tibble: 1 x 8
## n_exposed n_unexposed n_total risk_difference
## <dbl> <dbl> <dbl> <dbl>
## 1 524. 1573. 2097. 0.1
## # … with 4 more variables: precision <dbl>,
## # exposed <dbl>, unexposed <dbl>,
## # group_ratio <dbl>
21 / 39

Estimating n for odds ratios

precisely::n_odds_ratio(
precision = 2,
exposed_cases = .4,
exposed_controls = .3,
group_ratio = 4
)
22 / 39

Estimating n for odds ratios

precisely::n_odds_ratio(
precision = 2,
exposed_cases = .4,
exposed_controls = .3,
group_ratio = 4
)
## # A tibble: 1 x 9
## n_cases n_controls n_total odds_ratio precision
## <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 171. 685. 857. 1.56 2
## # … with 4 more variables: exposed_cases <dbl>,
## # exposed_controls <dbl>, group_ratio <dbl>,
## # ci <dbl>
23 / 39
measure differences ratios
risks ✔️ ✔️
rates ✔️ ✔️
odds ✖️ ✔️
24 / 39

Estimating precision given sample size

precision_odds_ratio(
n_cases = 500,
exposed_cases = .6,
exposed_controls = .4,
group_ratio = 2
)
25 / 39

Estimating precision given sample size

precision_odds_ratio(
n_cases = 500,
exposed_cases = .6,
exposed_controls = .4,
group_ratio = 2
)
## # A tibble: 1 x 9
## precision odds_ratio n_cases n_controls n_total
## <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 1.55 2.25 500 1000 1500
## # … with 4 more variables: exposed_cases <dbl>,
## # exposed_controls <dbl>, group_ratio <dbl>,
## # ci <dbl>
26 / 39

Vignettes and more: precisely.malco.io

27 / 39

Vignettes and more: precisely.malco.io

27 / 39

What's the baggage?

29 / 39

What's the baggage?

precision == probability of estimate being true?

30 / 39
31 / 39

What's the baggage?

precision == probability of estimate being true?

The ghost of statistical testing shall always haunt us

32 / 39
33 / 39
34 / 39

precisely lets you estimate sample size based on precision instead of significance

35 / 39

precisely lets you estimate sample size based on precision instead of significance

calculate n for common measures, like risk difference and risk ratio

36 / 39

precisely lets you estimate sample size based on precision instead of significance

calculate n for common measures, like risk difference and risk ratio

Work in R or on the web

37 / 39

Appendix

38 / 39
39 / 39
2 / 39
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow