update.Spower | R Documentation |
When a power or compromise analysis was performed in
Spower
this function can be used to
update the compromise or power criteria without the need for re-simulating
the experiment. For compromise analyses a beta_alpha
criteria
must be supplied, while for prospective/post-hoc power analyses the sig.level
must be supplied.
## S3 method for class 'Spower'
update(object, sig.level = 0.05, beta_alpha = NULL, predCI = 0.95, ...)
object |
object returned from |
sig.level |
Type I error rate (alpha) |
beta_alpha |
Type II/Type I error ratio |
predCI |
confidence interval precision (see |
... |
arguments to be passed |
object of class Spower
with updated information
Phil Chalmers rphilip.chalmers@gmail.com
########
## Prospective power analysis update
# Estimate power using sig.level = .05 (default)
out <- p_t.test(n = 50, d = .5) |> Spower()
# update power estimate given sig.level=.01 and .20
update(out, sig.level=.01)
update(out, sig.level=.20)
########
## Compromise analysis update
# Solve beta/alpha ratio to specific error trade-off constant
out <- p_t.test(n = 50, d = .5) |> Spower(beta_alpha = 2)
# update beta_alpha criteria without re-simulating
update(out, beta_alpha=4)
# also works if compromise not initially run but prospective/post-hoc power was
out <- p_t.test(n = 50, d = .5) |> Spower()
update(out, beta_alpha=4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.