betapower: Find Power with Beta DBN

Description Usage Arguments Details Value Examples

Description

Find the power for a given sample size when testing the null hypothesis that the means for the control and treatment groups are equal against a two-sided alternative.

Usage

1
2
betapower(mu0, sd0, mu1.start, mu1.end, mu1.by, 
ss.start, ss.end, ss.by, trials, seed, 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

ss.start

the starting value of sample size

ss.end

the ending value of sample size

ss.by

the step length of sample size

trials

the number of trials

seed

the seed used in the simulation

link.type

the type of link used in the beta regression. Default value is "logit", or you can choose one or more of the following: "logit", "probit", "cloglog", "cauchit", "log", "loglog", "all"

Details

betapower function allows you to control the number of trials in the simulation, the sample sizes used, and the alternative means. You can fix the alternative and vary sample size to match a desired power; You can fix the sample size and vary the alternative to see which will match a desired power; You can vary both; Start with a small number of trials (say 100) to determine the rough range of sample sizes or alternatives; Use a larger number of trials (say 1000) to get better estimates.

Value

Return a matrix with 7 to 12 columns:

power.of.GLM: link name

the power using regression method; it will return the power with every links if you use link.type = "all" statement.

power.of.Wilcoxon.test

the power from Wilcoxon Rank sum test.

sample size

sample size.

mu1

the mean for the treatment group under the alternative.

mu0

the mean for the control group.

sd0

the standard deviation for the control group.

trials

the number of trials.

Examples

1
2
3
betapower(0.56,0.255,.70,.75,.05,30,50, 20,40,610201501)
betapower(0.56,0.255,.60,.75,.05,30,50, 5,100,617201501,"all")
betapower(0.56,0.255,.70,.75,.05,30,50, 20,40,610201501,c("logit","loglog","log"))

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