pwr_freq | R Documentation |
Constructs a simple hypothesis testing framework based on the parameters specified and returns the corresponding frequentist power.
pwr_freq(n, theta_0, theta_1, sigsq, alt, alpha)
n |
sample size (either scalar or vector) |
theta_0 |
initial value the parameter is set equal to in the null hypothesis, where H0: θ = θ 0. |
theta_1 |
alternative value to be compared to theta_0. See alt for specification options. |
sigsq |
known variance σ^2 |
alt |
specifies comparison between θ_1 and θ_0,
where |
alpha |
significance level |
objects corresponding to the power
pwr_table: table of sample sizes and corresponding power values.
pwr_plot: power curve that is only returned if n is a vector. This power curve covers a wider range of sample sizes than the inputted values specified for n, where specific power values are marked in red.
power_val: single power value that is returned if n is a scalar.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.