pwr_freq {bayesassurance}R Documentation

Frequentist Power Computation

Description

Constructs a simple hypothesis testing framework based on the parameters specified and returns the corresponding frequentist power.

Usage

pwr_freq(n, theta_0, theta_1, sigsq, alt, alpha)

Arguments

n

sample size (either scalar or vector)

theta_0

initial value the parameter is set equal to in the null hypothesis, where H0: \theta = \theta 0.

theta_1

alternative value to be compared to theta_0. See alt for specification options.

sigsq

known variance \sigma^2

alt

specifies comparison between \theta_1 and \theta_0, where alt = "greater" tests if \theta_1 > \theta_0, alt = "less" tests if \theta_1 < \theta_0, and alt = "two.sided" performs a two-sided test. alt = "greater" by default.

alpha

significance level

Value

objects corresponding to the power

Examples

n <- seq(10, 140, 5)
theta_0 <- 0.15
theta_1 <- 0.35
sigsq <- 0.3

pwr_vals <- pwr_freq(n = n, theta_0 = theta_0, theta_1 = theta_1, 
sigsq = sigsq, alt = "greater", alpha = 0.05)
pwr_vals$pwr_plot

[Package bayesassurance version 0.1.0 Index]