solve_n: Solve for 'n' at specific power value.

View source: R/solve-n.R

solve_nR Documentation

Solve for n at specific power value.

Description

Solve for the sample size (n) for a specified power value. This function effectively inverts the power curve and efficiently returns the sample size for a given power.

Usage

solve_n(x, pwr)

Arguments

x

A "power_curve" object. See fisher_power_curve() or t_power_curve().

pwr

double(1) in ⁠(0, 1)⁠. The power to be interpolated.

Examples

tbl <- fisher_power_curve(seq(50, 400, 25))
solve_n(tbl, 0.85)

solve_n(tbl, 0.75)

solve_n(tbl, 0.55)

stufield/power documentation built on June 1, 2025, 7:16 p.m.