Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

power_Beta

Power Calculations for Test of Two Beta Means


Description

Compute the power for a test of two sample means with beta distributions, or determine the minimum sample size to obtain a target power.

Usage

power_Beta(n1 = NULL, n2 = NULL,  mu1 = NULL, mu2 = NULL, 
sd1 = NULL, sd2 = NULL, sig.level = 0.05, power = NULL, 
equal.sample = TRUE, equal.precision = TRUE, trials = 100, 
link.type = c("logit", "probit", "cloglog", "cauchit", "log", "loglog"))

Arguments

n1

sample size in group 1, or sample size in each group if equal.sample = TRUE

n2

sample size in group 2

mu1

sample mean of group 1

mu2

sample mean of group 2

sd1

standard deviation for group 1

sd2

standard deviation for group 2. Only applicable when equal.precision = FALSE

sig.level

significance level (Type I error probability)

power

power of test (1 minus Type II error probability)

equal.sample

equal sample sizes for two groups, see details

equal.precision

equal dispersion parameter assumption in simulation

trials

number of trials in simulation

link.type

type of link used in the beta regression, see details

Details

Exactly one of the parameters n1, n2 and power must be passed as NULL, and that parameter is determined from the others.

If equal.sample = TRUE is used, exactly one of the parameters n1 and power must be passed as NULL, and N in output will denote the number in each group.

This function allows you to set the number of trials in the simulation to control the result accuracy, and type of link used in the beta regression. You can choose one of the following: "logit", "probit", "cloglog", "cauchit", "log", "loglog".

Value

Object of class "power.htest", a list of the arguments (including the computed one) augmented with method and note elements.

Examples

# calculate power
power_Beta(n1 = 60, mu1 = 0.5, mu2 = 0.80, sd1 = 0.25)
# calculate sample size for both groups
power_Beta(mu1 = 0.5, mu2 = 0.80, sd1 = 0.25, power = 0.8)

PASSED

Calculate Power and Sample Size for Two Sample Mean Tests

v1.1-0
GPL (>= 2)
Authors
Jinpu Li [aut, cre], Ryan Knigge [aut], Kaiyi Chen [aut], Emily Leary [aut]
Initial release
2021-05-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.