sample.size: Find minimum sample size with Beta DBN

Description Usage Arguments Details Value Examples

Description

Find minimum sample sizes with Beta DBN and given mu0,sd0,mu1 and target powers.

Usage

1
2
sample.size(mu0, sd0, mu1.start, mu1.end, mu1.by, power.start, power.end, power.by,
sig.level = 0.05, trials = 100, accuracy = NuLL, seed = 1, link.type = "logit")

Arguments

mu0

the mean for the control group

sd0

the standard deviation for the control group

mu1.start

the starting value of mean for the treatment group under the alternative mu1

mu1.end

the ending value of mean for the treatment group under the alternative mu1

mu1.by

the step length of mean for the treatment group under the alternative mu1

power.start

the starting value of target power

power.end

the ending value of target power

power.by

the step length of target power

sig.level

significant level; default value is 0.05

trials

the number of trials; default value is 100

accuracy

the accuracy of the result; must be integer

seed

the seed used in the simulation

link.type

link options include: "logit", "probit", "cloglog", "log", "loglog", "wilcoxon". Default link is "logit".

Details

The sample.size function allows you to control the number of trials in the simulation, the target power, accuracy, and the alternative means. You can fix the alternative and vary power to match a desired sample size; Use default values for the number of trials and accuracy for a quick view; Use a larger number of trials (say 1000) and a smaller accuracy (say 1) to get better estimates.

Value

Return a matrix including minimum sample size and power, as well as the target power and mu1:

minimum sample size: link type:

minimum sample size for given given mu0, sd0, mu1, target power and type of link.

minimum power: link type:

the minimum power greater than or equal to target power.

target power:

the target power.

mu1:

mean for the treatment group under the alternative.

mu0:

the mean for the control group.

sd0:

the standard deviation for the control group.

Examples

1
2
3
4
5
6
sample.size(mu0=0.56, sd0=0.255, mu1.start = 0.60, mu1.end = 0.70, mu1.by = 0.05, 
power.start = 0.7, power.end = 0.9, power.by = 0.1)
sample.size(mu0=0.56, sd0=0.255, mu1.start = 0.60, mu1.end = 0.70, mu1.by = 0.05, 
power.start = 0.7, power.end = 0.9, power.by = 0.1, link.type = c("logit","loglog","log"))
sample.size(mu0=0.56, sd0=0.255, mu1.start = 0.60, mu1.end = 0.70, mu1.by = 0.05, 
power.start = 0.7, power.end = 0.9, power.by = 0.1, link.type = "all")

CastleLi/BetaPSS documentation built on May 15, 2019, 10:34 p.m.