update: Update compromise or prospective/post-hoc power analysis...

update.SpowerR Documentation

Update compromise or prospective/post-hoc power analysis without re-simulating

Description

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.

Usage

## S3 method for class 'Spower'
update(object, sig.level = 0.05, beta_alpha = NULL, predCI = 0.95, ...)

Arguments

object

object returned from Spower where power was estimated or the bete_alpha criteria were supplied

sig.level

Type I error rate (alpha)

beta_alpha

Type II/Type I error ratio

predCI

confidence interval precision (see Spower for similar input)

...

arguments to be passed

Value

object of class Spower with updated information

Author(s)

Phil Chalmers rphilip.chalmers@gmail.com

Examples



########
## 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)




Spower documentation built on April 4, 2025, 5:11 a.m.