Title: | Sample Size Calculations for Normal Means |
---|---|
Description: | Sample size requirements calculation using three different Bayesian criteria in the context of designing an experiment to estimate a normal mean or the difference between two normal means. Functions for calculation of required sample sizes for the Average Length Criterion, the Average Coverage Criterion and the Worst Outcome Criterion in the context of normal means are provided. Functions for both the fully Bayesian and the mixed Bayesian/likelihood approaches are provided. For reference see Joseph L. and Bélisle P. (1997) <https://www.jstor.org/stable/2988525>. |
Authors: | Lawrence Joseph [aut], Patrick Bélisle [aut, cre] |
Maintainer: | Patrick Bélisle <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.2.3 |
Built: | 2024-12-16 06:38:54 UTC |
Source: | CRAN |
Sample size determination based on highest posterior density intervals for normal means and difference between normal means using three different Bayesian approaches
Package: | SampleSizeMeans |
Type: | Package |
Version: | 1.2.3 |
Date: | 2023-08-22 |
License: | GLP (version 2 or later) |
URL: | http://www.medicine.mcgill.ca/epidemiology/Joseph/Methodological-Publications-Bayesian-Sample-Size.html |
A set of R functions for calculating sample size requirements using
three different Bayesian criteria in the context of designing an
experiment to estimate normal means or the difference between two normal
means. Criteria include the Average Length Criterion, the Average
Coverage Criterion and the Modified Worst Outcome Criterion. Functions for both
the fully Bayesian and the mixed Bayesian/likelihood approaches are
provided.
See the related package SampleSizeProportions for Bayesian sample size determination for the difference between two binomial proportions
https://CRAN.R-project.org/package=SampleSizeProportions
Lawrence Joseph and Patrick Bélisle
Maintainer: Patrick Bélisle [email protected]
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.freq
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mudiff.freq
The function mu.acc
returns the required sample size
to reach a given coverage probability on average for a posterior credible interval of fixed length for a normal mean.
mu.acc(len, alpha, beta, n0, level=0.95)
mu.acc(len, alpha, beta, n0, level=0.95)
len |
The desired fixed length of the posterior credible interval for the mean |
alpha |
First parameter of the Gamma prior density for the precision (reciprocal of the variance) |
beta |
Second parameter of the Gamma prior density for the precision (reciprocal of the variance) |
n0 |
Prior sample size equivalent for the mean |
level |
The desired average coverage probability of the posterior credible interval (e.g., 0.95) |
Assume that a sample will be collected in order to estimate
the mean of a normally distributed random variable. Assume that the precision (reciprocal of the variance) of
this random variable is unknown, but has prior information in the form of a
Gamma(alpha, beta) density. Assume that the mean is unknown, but has
prior information equivalent to n0 previous observations . The function mu.acc
returns the
required sample size to attain the desired average coverage probability level
for the posterior credible interval of fixed length len for the unknown mean.
This function uses a fully Bayesian approach to sample size determination.
Therefore, the desired coverages and lengths are only realized if the prior distributions input to the function
are used for final inferences. Researchers preferring to use the data only for final inferences are encouraged
to use the Mixed Bayesian/Likelihood version of the function.
The required sample size given the inputs to the function.
The sample size returned by this function is exact.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mu.alc
, mu.modwoc
, mu.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.freq
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mudiff.freq
mu.acc(len=0.2, alpha=2, beta=2, n0=10)
mu.acc(len=0.2, alpha=2, beta=2, n0=10)
The function mu.alc
returns the required sample size
to reach a given posterior credible interval length on average for a fixed coverage probability for a normal mean.
mu.alc(len, alpha, beta, n0, level = 0.95)
mu.alc(len, alpha, beta, n0, level = 0.95)
len |
The desired average length of the posterior credible interval for the mean |
alpha |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) |
beta |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) |
n0 |
Prior sample size equivalent for the mean |
level |
The desired fixed coverage probability of the posterior credible interval (e.g., 0.95) |
Assume that a sample will be collected in order to estimate
the mean of a normally distributed random variable. Assume that the precision (reciprocal of the variance) of
this random variable is unknown, but has prior information in the form of a
Gamma(alpha, beta) density. Assume that the mean is unknown, but has
prior information equivalent to n0 previous observations.
The function mu.alc
returns the required sample size
to attain the desired average length len for the posterior credible interval
of fixed coverage probability level for the unknown mean.
This function uses a fully Bayesian approach to sample size determination.
Therefore, the desired coverages and lengths are only realized if the prior distributions input to the function
are used for final inferences. Researchers preferring to use the data only for final inferences are encouraged
to use the Mixed Bayesian/Likelihood version of the function.
The required sample size given the inputs to the function.
The sample size returned by this function is exact.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mu.acc
, mu.modwoc
, mu.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.freq
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mudiff.freq
mu.alc(len=0.2, alpha=2, beta=2, n0=10)
mu.alc(len=0.2, alpha=2, beta=2, n0=10)
The function mu.freq
returns the required sample size
to obtain a confidence interval of given length and confidence level for a normal mean.
mu.freq(len, lambda, level = 0.95)
mu.freq(len, lambda, level = 0.95)
len |
The desired total length of the confidence interval for the mean |
lambda |
Known precision (reciprocal of variance) |
level |
The desired confidence level (e.g., 0.95) |
Assume that a random sample will be collected in order to estimate
the mean of a normally distributed random variable with known precision lambda (precision is the reciprocal of the variance).
The function mu.freq
returns the required sample size to attain the
desired length len and confidence level level for a confidence interval
for the mean from a frequentist point of view.
The required sample size given the inputs to the function.
The sample size returned by this function is exact.
Lawrence Joseph [email protected] and Patrick Bélisle
Lemeshow S, Hosmer Jr DW, Klar J, Lwanga SK.
Adequacy of Sample Size in Health Studies. Wiley and Sons, New York, 1990.
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mudiff.freq
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
# Suppose the variance = 4 mu.freq(len=0.2, lambda=1/4)
# Suppose the variance = 4 mu.freq(len=0.2, lambda=1/4)
The function mu.mbl.varknown
returns the required sample size
to reach a desired posterior credible interval length and coverage probability for a normal mean - using a mixed Bayesian/likelihood approach - when the variance is known.
mu.mbl.varknown(len, lambda, level = 0.95)
mu.mbl.varknown(len, lambda, level = 0.95)
len |
The desired total length of the posterior credible interval for the mean |
lambda |
The known precision (reciprocal of variance) |
level |
The desired coverage probability of the posterior credible interval (e.g., 0.95) |
Assume that a sample will be collected in order to estimate
the mean of a normally distributed random variable with known precision lambda (where the precision is the reciprocal of the variance).
The function mu.mbl.varknown
returns the
required sample size to attain the desired length len and
coverage probability level for the posterior credible interval for the unknown mean.
This function uses a Mixed Bayesian/Likelihood (MBL) approach.
MBL approaches use the prior information to derive the predictive distribution of the data, but use only the likelihood function for final inferences.
This approach is intended to satisfy investigators who recognize that prior information is important for planning purposes but prefer to base final inferences only on the data.
The required sample size given the inputs to the function.
The sample size returned by this function is exact.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.varknown
, mu.acc
, mu.alc
, mu.modwoc
, mu.freq
, mudiff.mbl.varknown
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.varknown
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.freq
mu.mbl.varknown(len=0.2, lambda=1/4)
mu.mbl.varknown(len=0.2, lambda=1/4)
The function mu.mblacc
returns the required sample size
to reach a given coverage probability on average - using a mixed Bayesian/likelihood approach - for a posterior credible interval of fixed length for a normal mean.
mu.mblacc(len, alpha, beta, level = 0.95, m = 10000, mcs = 3)
mu.mblacc(len, alpha, beta, level = 0.95, m = 10000, mcs = 3)
len |
The desired fixed length of the posterior credible interval for the mean |
alpha |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) |
beta |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) |
level |
The desired average coverage probability of the posterior credible interval (e.g., 0.95) |
m |
The number of points simulated from the preposterior distribution of the data. For each point, the probability coverage of the highest posterior density interval of fixed length len is estimated, in order to approximate the average coverage probability. Usually 10000 is sufficient, but one can increase this number at the expense of program running time. |
mcs |
The Maximum number of Consecutive Steps allowed in the same direction in the march towards the optimal sample size, before the result for the next upper/lower bound is cross-checked. In our experience, mcs = 3 is a good choice. |
Assume that a sample will be collected in order to estimate
the mean of a normally distributed random variable. Assume that the precision (reciprocal of the variance) of
this random variable is unknown, but has prior information in the form of a
Gamma(alpha, beta) density.
The function mu.mblacc
returns the
required sample size to attain the desired average coverage probability level
for the posterior credible interval of fixed length len
for the unknown mean.
This function uses a Mixed Bayesian/Likelihood (MBL) approach.
MBL approaches use the prior information to derive the predictive distribution of the data, but use only the likelihood function for final inferences.
This approach is intended to satisfy investigators who recognize that prior information is important for planning purposes but prefer to base final inferences only on the data.
The required sample size given the inputs to the function.
The sample size is calculated via Monte Carlo simulations, and therefore may vary from one call to the next.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.freq
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.freq
mu.mblacc(len=0.2, alpha=2, beta=2)
mu.mblacc(len=0.2, alpha=2, beta=2)
The function mu.mblalc
returns the required sample size
to reach a given posterior credible interval length on average - using a mixed Bayesian/likelihood approach - for a fixed coverage probability for a normal mean.
mu.mblalc(len, alpha, beta, level = 0.95)
mu.mblalc(len, alpha, beta, level = 0.95)
len |
The desired average length of the posterior credible interval for the mean |
alpha |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) |
beta |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) |
level |
The desired fixed coverage probability of the posterior credible interval (e.g., 0.95) |
Assume that a sample will be collected in order to estimate
the mean of a normally distributed random variable. Assume that the precision (reciprocal of the variance) of
this random variable is unknown, but has prior information in the form of a
Gamma(alpha, beta) density.
The function mu.mblalc
returns the
required sample size to attain the desired average length len
for the posterior credible interval of fixed coverage probability level
for the unknown mean.
This function uses a Mixed Bayesian/Likelihood (MBL) approach.
MBL approaches use the prior information to derive the predictive distribution of the data, but use only the likelihood function for final inferences.
This approach is intended to satisfy investigators who recognize that prior information is important for planning purposes but prefer to base final inferences only on the data.
The required sample size given the inputs to the function.
The sample size returned by this function is exact.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mu.mblacc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.freq
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.freq
mu.mblalc(len=0.2, alpha=2, beta=2)
mu.mblalc(len=0.2, alpha=2, beta=2)
The function mu.mblmodwoc
uses a mixed Bayesian/likelihood approach to
determine conservative sample sizes, in the sense that the desired posterior credible interval coverage and length for a normal mean are guaranteed
over a given proportion of data sets that can arise according to the prior information.
mu.mblmodwoc(len, alpha, beta, level = 0.95, worst.level = 0.95, m = 50000, mcs = 3)
mu.mblmodwoc(len, alpha, beta, level = 0.95, worst.level = 0.95, m = 50000, mcs = 3)
len |
The desired total length of the posterior credible interval for the mean |
alpha |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) |
beta |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) |
level |
The desired fixed coverage probability of the posterior credible interval (e.g., 0.95) |
worst.level |
The probability that the length of the posterior credible interval of fixed coverage probability level will be at most len |
m |
The number of points simulated from the preposterior distribution of the data. For each point, the length of the highest posterior density interval of fixed coverage probability level is estimated, in order to approximate the (100*worst.level)%-percentile of the posterior credible interval length. Usually 50000 is sufficient, but one can increase this number at the expense of program running time. |
mcs |
The Maximum number of Consecutive Steps allowed in the same direction in the march towards the optimal sample size, before the result for the next upper/lower bound is cross-checked. In our experience, mcs = 3 is a good choice. |
Assume that a sample will be collected in order to estimate
the mean of a normally distributed random variable. Assume that the precision (reciprocal of the variance) of
this random variable is unknown, but has prior information in the form of a
Gamma(alpha, beta) density.
The function mu.mblmodwoc
returns the required sample size to attain the desired length len
for the posterior credible interval of fixed coverage probability level for the unknown mean.
The Modified Worst Outcome Criterion used is conservative, in the sense that the posterior credible interval
length len is guaranteed over the worst.level proportion of all
possible data sets that can arise according to the prior information, for a fixed coverage probability level.
This function uses a Mixed Bayesian/Likelihood (MBL) approach.
MBL approaches use the prior information to derive the predictive distribution
of the data, but uses only the likelihood function for final inferences.
This approach is intended to satisfy investigators who recognize that prior
information is important for planning purposes but prefer to base final
inferences only on the data.
The required sample size given the inputs to the function.
The sample size is calculated via Monte Carlo simulations, and therefore may vary from one call to the next.
It is also correct to state that the coverage probability of the posterior credible interval of fixed length len will be at least level with probability worst.level with the sample size returned.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mu.mblacc
, mu.mblalc
, mu.mbl.varknown
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.freq
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.freq
mu.mblmodwoc(len=0.2, alpha=2, beta=2)
mu.mblmodwoc(len=0.2, alpha=2, beta=2)
The function mu.modwoc
calculates conservative sample sizes, in the sense that the desired
posterior credible interval coverage and length for a normal mean are guaranteed over a given proportion of data sets that can arise according to the prior information.
mu.modwoc(len, alpha, beta, n0, level = 0.95, worst.level = 0.95)
mu.modwoc(len, alpha, beta, n0, level = 0.95, worst.level = 0.95)
len |
The desired length of the posterior credible interval for the mean |
alpha |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) |
beta |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) |
n0 |
Prior sample size equivalent for the mean |
level |
The desired fixed coverage probability of the posterior credible interval (e.g., 0.95) |
worst.level |
The probability that the length of the posterior credible interval of fixed coverage probability level will be at most len |
Assume that a sample will be collected in order to estimate
the mean of a normally distributed random variable. Assume that the precision (reciprocal of the variance) of
this random variable is unknown, but has prior information in the form of a
Gamma(alpha, beta) density. Assume that the mean is unknown, but has
prior information equivalent to n0 previous observations. The function mu.modwoc
returns the required sample size to attain the desired length len
for the posterior credible interval of fixed coverage probability level
for the unknown mean.
The Modified Worst Outcome Criterion used is conservative, in the sense that the posterior credible interval
length len is guaranteed over the worst.level proportion of all
possible data sets that can arise according to the prior information, for a fixed coverage probability level.
This function uses a fully Bayesian approach to sample size determination.
Therefore, the desired coverages and lengths are only realized if the prior distributions input to the function
are used for final inferences. Researchers preferring to use the data only for final inferences are encouraged
to use the Mixed Bayesian/Likelihood version of the function.
The required sample size given the inputs to the function.
The sample size returned by this function is exact.
It is also correct to state that the coverage probability of the posterior credible interval of fixed length len will be at least level with probability worst.level with the sample size returned.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mu.acc
, mu.alc
, mu.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.freq
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mudiff.freq
mu.modwoc(len=0.2, alpha=2, beta=2, n0=10)
mu.modwoc(len=0.2, alpha=2, beta=2, n0=10)
The function mu.varknown
returns the required sample size
to reach a desired posterior credible interval length and coverage probability for a normal mean when the variance is known.
mu.varknown(len, lambda, n0, level = 0.95)
mu.varknown(len, lambda, n0, level = 0.95)
len |
The desired total length of the posterior credible interval for the mean |
lambda |
The known precision (reciprocal of variance) |
n0 |
Prior sample size equivalent for the mean |
level |
The desired coverage probability of the posterior credible interval (e.g., 0.95) |
Assume that a sample will be collected in order to estimate
the mean of a normally distributed random variable with known precision lambda (where the precision is the reciprocal of the variance).
Assume that the mean is unknown, but has
prior information equivalent to n0 previous observations. The function mu.varknown
returns the
required sample size to attain the desired length len and
coverage probability level for the posterior credible interval for the unknown mean.
This function uses a fully Bayesian approach to sample size determination.
Therefore, the desired coverages and lengths are only realized if the prior distributions input to the function
are used for final inferences. Researchers preferring to use the data only for final inferences are encouraged
to use the Mixed Bayesian/Likelihood version of the function.
The required sample size given the inputs to the function.
The sample size returned by this function is exact.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mu.acc
, mu.alc
, mu.modwoc
, mu.mbl.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.freq
, mudiff.varknown
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.mbl.varknown
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.freq
mu.varknown(len=0.2, lambda=1/4, n0=10)
mu.varknown(len=0.2, lambda=1/4, n0=10)
The function mudiff.acc
returns the required sample sizes
to reach a given coverage probability on average for a posterior credible interval of fixed length for the difference between two normal means.
mudiff.acc(len, alpha1, beta1, alpha2, beta2, n01, n02, level = 0.95, equal = TRUE, m = 10000, mcs = 3)
mudiff.acc(len, alpha1, beta1, alpha2, beta2, n01, n02, level = 0.95, equal = TRUE, m = 10000, mcs = 3)
len |
The desired fixed length of the posterior credible interval for the difference between the two unknown means |
|||||||||
alpha1 |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) for the first population |
|||||||||
beta1 |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) for the first population |
|||||||||
alpha2 |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) for the second population |
|||||||||
beta2 |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) for the second population |
|||||||||
n01 |
Prior sample size equivalent for the mean for the first population |
|||||||||
n02 |
Prior sample size equivalent for the mean for the second population |
|||||||||
level |
The desired average coverage probability of the posterior credible interval (e.g., 0.95) |
|||||||||
equal |
logical. Whether or not the final group sizes (n1, n2) are forced to be equal:
|
|||||||||
m |
The number of points simulated from the preposterior distribution of the data. For each point, the probability coverage of the highest posterior density interval of fixed length len is estimated, in order to approximate the average coverage probability. Usually 10000 is sufficient, but one can increase this number at the expense of program running time. |
|||||||||
mcs |
The Maximum number of Consecutive Steps allowed in the same direction in the march towards the optimal sample size, before the result for the next upper/lower bound is cross-checked. In our experience, mcs = 3 is a good choice. |
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means.
Assume that the precision within each of the two the populations are
unknown, but have prior information in the form of
Gamma(alpha1, beta1) and Gamma(alpha2, beta2) densities, respectively.
Assume that the means are unknown, but have prior information equivalent to (n01, n02) previous observations, respectively.
The function mudiff.acc
returns the required sample sizes to attain the
average coverage probability level for the posterior credible interval of fixed length len
for the difference between the two unknown means.
This function uses a fully Bayesian approach to sample size determination.
Therefore, the desired coverages and lengths are only realized if the prior distributions input to the function
are used for final inferences. Researchers preferring to use the data only for final inferences are encouraged
to use the Mixed Bayesian/Likelihood version of the function.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes are calculated via Monte Carlo simulations, and therefore may vary from one call to the next.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mudiff.freq
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.freq
mudiff.acc(len=0.2, alpha1=2, beta1=2, alpha2=3, beta2=3, n01=10, n02=25)
mudiff.acc(len=0.2, alpha1=2, beta1=2, alpha2=3, beta2=3, n01=10, n02=25)
The function mudiff.acc.equalvar
returns the required sample sizes
to reach a given coverage probability on average for a posterior credible interval of fixed length for the difference between two normal means, when variances are equal.
mudiff.acc.equalvar(len, alpha, beta, n01, n02, level = 0.95, equal = TRUE)
mudiff.acc.equalvar(len, alpha, beta, n01, n02, level = 0.95, equal = TRUE)
len |
The desired fixed length of the posterior credible interval for the difference between the two unknown means |
|||||||||
alpha |
First prior parameter of the Gamma density for the common precision (reciprocal of the variance) |
|||||||||
beta |
Second prior parameter of the Gamma density for the common precision (reciprocal of the variance) |
|||||||||
n01 |
Prior sample size equivalent for the mean for the first population |
|||||||||
n02 |
Prior sample size equivalent for the mean for the second population |
|||||||||
level |
The desired average coverage probability of the posterior credible interval (e.g., 0.95) |
|||||||||
equal |
logical. Whether or not the final group sizes (n1, n2) are forced to be equal:
|
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means.
Assume that the precisions of the two normal sampling distributions are
unknown but equal, with prior information in the form of a Gamma(alpha,
beta) density. Assume that the means are unknown, but have
prior information equivalent to (n01, n02) previous observations, respectively.
The function mudiff.acc.equalvar
returns the required sample sizes to attain the
desired average coverage probability level for the posterior credible interval of fixed length len
for the difference between the two unknown means.
This function uses a fully Bayesian approach to sample size determination.
Therefore, the desired coverages and lengths are only realized if the prior distributions input to the function
are used for final inferences. Researchers preferring to use the data only for final inferences are encouraged
to use the Mixed Bayesian/Likelihood version of the function.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes returned by this function are exact.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.varknown
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mbl.varknown
, mudiff.freq
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.freq
mudiff.acc.equalvar(len=0.2, alpha=2, beta=2, n01=10, n02=50)
mudiff.acc.equalvar(len=0.2, alpha=2, beta=2, n01=10, n02=50)
The function mudiff.alc
returns the required sample sizes
to reach a desired posterior credible interval length on average for a fixed coverage probability for the difference between two normal means.
mudiff.alc(len, alpha1, beta1, alpha2, beta2, n01, n02, level = 0.95, equal = TRUE, m = 10000, mcs = 3)
mudiff.alc(len, alpha1, beta1, alpha2, beta2, n01, n02, level = 0.95, equal = TRUE, m = 10000, mcs = 3)
len |
The desired average length of the posterior credible interval for the difference between the two unknown means |
|||||||||
alpha1 |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) for the first population |
|||||||||
beta1 |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) for the first population |
|||||||||
alpha2 |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) for the second population |
|||||||||
beta2 |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) for the second population |
|||||||||
n01 |
Prior sample size equivalent for the mean for the first population |
|||||||||
n02 |
Prior sample size equivalent for the mean for the second population |
|||||||||
level |
The desired fixed coverage probability of the posterior credible interval (e.g., 0.95) |
|||||||||
equal |
logical. Whether or not the final group sizes (n1, n2) are forced to be equal:
|
|||||||||
m |
The number of points simulated from the preposterior distribution of the data. For each point, the length of the highest posterior density interval of fixed coverage probability level is estimated, in order to approximate the average length. Usually 10000 is sufficient, but one can increase this number at the expense of program running time. |
|||||||||
mcs |
The Maximum number of Consecutive Steps allowed in the same direction in the march towards the optimal sample size, before the result for the next upper/lower bound is cross-checked. In our experience, mcs = 3 is a good choice. |
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means.
Assume that the precision within each of the two the populations are
unknown, but have prior information in the form of
Gamma(alpha1, beta1) and Gamma(alpha2, beta2) densities, respectively.
Assume that the means are unknown, but have
prior information equivalent to (n01, n02) previous observations, respectively. The function
mudiff.alc
returns the required sample sizes to attain the
desired average length len for the posterior credible interval of fixed coverage probability level
for the difference between the two unknown means.
This function uses a fully Bayesian approach to sample size determination.
Therefore, the desired coverages and lengths are only realized if the prior distributions input to the function
are used for final inferences. Researchers preferring to use the data only for final inferences are encouraged
to use the Mixed Bayesian/Likelihood version of the function.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes are calculated via Monte Carlo simulations, and therefore may vary from one call to the next.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.acc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mudiff.freq
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.freq
mudiff.alc(len=0.2, alpha1=2, beta1=2, alpha2=3, beta2=3, n01=10, n02=25)
mudiff.alc(len=0.2, alpha1=2, beta1=2, alpha2=3, beta2=3, n01=10, n02=25)
The function mudiff.alc.equalvar
returns the required sample sizes
to reach a given posterior credible interval length on average for a fixed coverage probability for the difference between two normal means, when variances are equal.
mudiff.alc.equalvar(len, alpha, beta, n01, n02, level = 0.95, equal = TRUE)
mudiff.alc.equalvar(len, alpha, beta, n01, n02, level = 0.95, equal = TRUE)
len |
The desired average length of the posterior credible interval for the difference between the two unknown means |
|||||||||
alpha |
First prior parameter of the Gamma density for the common precision (reciprocal of the variance) |
|||||||||
beta |
Second prior parameter of the Gamma density for the common precision (reciprocal of the variance) |
|||||||||
n01 |
Prior sample size equivalent for the mean for the first population |
|||||||||
n02 |
Prior sample size equivalent for the mean for the second population |
|||||||||
level |
The desired fixed coverage probability of the posterior credible interval (e.g., 0.95) |
|||||||||
equal |
logical. Whether or not the final group sizes (n1, n2) are forced to be equal:
|
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means.
Assume that the precisions of the two normal sampling distributions are
unknown but equal, with prior information in the form of a Gamma(alpha,
beta) density. Assume that the means are unknown, but have
prior information equivalent to (n01, n02) previous observations, respectively. The function
mudiff.alc.equalvar
returns the required sample sizes to attain the
desired average length len for the posterior credible interval of fixed coverage probability level
for the difference between the two unknown means.
This function uses a fully Bayesian approach to sample size determination.
Therefore, the desired coverages and lengths are only realized if the prior distributions input to the function
are used for final inferences. Researchers preferring to use the data only for final inferences are encouraged
to use the Mixed Bayesian/Likelihood version of the function.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes returned by this function are exact.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.acc.equalvar
, mudiff.modwoc.equalvar
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.varknown
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mbl.varknown
, mudiff.freq
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.freq
mudiff.alc.equalvar(len=0.2, alpha=2, beta=2, n01=10, n02=50)
mudiff.alc.equalvar(len=0.2, alpha=2, beta=2, n01=10, n02=50)
The function mudiff.freq
returns the required sample sizes
to get a confidence interval of given length and confidence level for the difference between two normal means.
mudiff.freq(len, lambda1, lambda2, level = 0.95, equal=TRUE)
mudiff.freq(len, lambda1, lambda2, level = 0.95, equal=TRUE)
len |
The desired total length of the confidence interval for the difference between the two unknown means |
|||||||||
lambda1 |
Known precision (reciprocal of the variance) for the first population |
|||||||||
lambda2 |
Known precision (reciprocal of the variance) for the second population |
|||||||||
level |
The desired confidence level (e.g., 0.95) |
|||||||||
equal |
logical. Whether or not the final group sizes (n1, n2) are forced to be equal:
|
Assume that a random sample from each of two populations will be
collected in order to estimate the difference between two independent normal means.
Assume further that the two precisions lambda1 and lambda2 are known (where precision is the reciprocal of the variance).
The function mudiff.freq
returns the required sample sizes to attain the
desired length len and confidence level level for the confidence interval
for the difference between the two unknown means from a frequentist point of view.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes returned by this function are exact.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mu.freq
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
# Suppose variance1 = 2, variance2 = 4 mudiff.freq(len=0.2, lambda1=1/2, lambda2=1/4)
# Suppose variance1 = 2, variance2 = 4 mudiff.freq(len=0.2, lambda1=1/2, lambda2=1/4)
The function mudiff.mbl.varknown
returns the required sample sizes
to reach a given posterior credible interval length and coverage probability for the difference between two normal means - using a mixed Bayesian/likelihood approach - when variances are known.
mudiff.mbl.varknown(len, lambda1, lambda2, level = 0.95, equal = TRUE)
mudiff.mbl.varknown(len, lambda1, lambda2, level = 0.95, equal = TRUE)
len |
The desired total length of the posterior credible interval for the difference between the two unknown means |
|||||||||
lambda1 |
The known precision (reciprocal of variance) for the first population |
|||||||||
lambda2 |
The known precision (reciprocal of variance) for the second population |
|||||||||
level |
The desired coverage probability of the posterior credible interval (e.g., 0.95) |
|||||||||
equal |
logical. Whether or not the final group sizes (n1, n2) are forced to be equal:
|
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means
when the variances are known.
The function mudiff.mbl.varknown
returns the required sample sizes to attain the
desired length len and coverage probability level for the posterior credible interval
for the difference between the two unknown means.
This function uses a Mixed Bayesian/Likelihood (MBL) approach.
MBL approaches use the prior information to derive the predictive distribution of the data, but use only the likelihood function for final inferences.
This approach is intended to satisfy investigators who recognize that prior information is important for planning purposes but prefer to base final inferences only on the data.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes returned by this function are exact.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.varknown
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.freq
, mu.mbl.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.varknown
, mu.acc
, mu.alc
, mu.modwoc
, mu.freq
mudiff.mbl.varknown(len=0.2, lambda1=1, lambda2=1/1.5)
mudiff.mbl.varknown(len=0.2, lambda1=1, lambda2=1/1.5)
The function mudiff.mblacc
returns the required sample sizes
to reach a given coverage probability on average for a posterior credible interval of fixed length - using a mixed Bayesian/likelihood approach - for the difference between two normal means.
mudiff.mblacc(len, alpha1, beta1, alpha2, beta2, level = 0.95, m = 10000, mcs = 3)
mudiff.mblacc(len, alpha1, beta1, alpha2, beta2, level = 0.95, m = 10000, mcs = 3)
len |
The desired fixed length of the posterior credible interval for the difference between the two unknown means |
alpha1 |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) for the first population |
beta1 |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) for the first population |
alpha2 |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) for the second population |
beta2 |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) for the second population |
level |
The desired average coverage probability of the posterior credible interval (e.g., 0.95) |
m |
The number of points simulated from the preposterior distribution of the data. For each point, the probability coverage of the highest posterior density interval of fixed length len is estimated, in order to approximate the average coverage probability. Usually 10000 is sufficient, but one can increase this number at the expense of program running time. |
mcs |
The Maximum number of Consecutive Steps allowed in the same direction in the march towards the optimal sample size, before the result for the next upper/lower bound is cross-checked. In our experience, mcs = 3 is a good choice. |
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means.
Assume that the precision within each of the two the populations are
unknown, but have prior information in the form of
Gamma(alpha1, beta1) and Gamma(alpha2, beta2) densities, respectively.
The function mudiff.mblacc
returns the required sample sizes to attain the
desired average coverage probability level for the posterior credible interval of fixed length len
for the difference between the two unknown means.
This function uses a Mixed Bayesian/Likelihood (MBL) approach.
MBL approaches use the prior information to derive the predictive distribution of the data, but use only the likelihood function for final inferences.
This approach is intended to satisfy investigators who recognize that prior information is important for planning purposes but prefer to base final inferences only on the data.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes are calculated via Monte Carlo simulations, and therefore may vary from one call to the next.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.freq
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.freq
mudiff.mblacc(len=0.2, alpha1=2, beta1=2, alpha2=3, beta2=3)
mudiff.mblacc(len=0.2, alpha1=2, beta1=2, alpha2=3, beta2=3)
The function mudiff.mblacc.equalvar
returns the required sample sizes
to reach a given coverage probability on average for a posterior credible interval of fixed length for the difference between two normal means using a mixed Bayesian/likelihood approach, when variances are equal.
mudiff.mblacc.equalvar(len, alpha, beta, level = 0.95, m = 10000, mcs = 3)
mudiff.mblacc.equalvar(len, alpha, beta, level = 0.95, m = 10000, mcs = 3)
len |
The desired fixed length of the posterior credible interval for the difference between the two unknown means |
alpha |
First prior parameter of the Gamma density for the common precision (reciprocal of the variance) |
beta |
Second prior parameter of the Gamma density for the common precision (reciprocal of the variance) |
level |
The desired average coverage probability of the posterior credible interval (e.g., 0.95) |
m |
The number of points simulated from the preposterior distribution of the data. For each point, the probability coverage of the highest posterior density interval of fixed length len is estimated, in order to approximate the average coverage probability. Usually 10000 is sufficient, but one can increase this number at the expense of program running time. |
mcs |
The Maximum number of Consecutive Steps allowed in the same direction in the march towards the optimal sample size, before the result for the next upper/lower bound is cross-checked. In our experience, mcs = 3 is a good choice. |
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means.
Assume that the precision within each of the two the populations are
unknown but equal, with prior information in the form of a Gamma(alpha,
beta) density.
The function mudiff.mblacc.equalvar
returns the required sample sizes to attain the
average coverage probability level for the posterior credible interval of fixed length len
for the difference between the two unknown means.
This function uses a Mixed Bayesian/Likelihood (MBL) approach.
MBL approaches use the prior information to derive the predictive distribution of the data, but use only the likelihood function for final inferences.
This approach is intended to satisfy investigators who recognize that prior information is important for planning purposes but prefer to base final inferences only on the data.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes are calculated via Monte Carlo simulations, and therefore may vary from one call to the next.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mbl.varknown
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.varknown
, mudiff.freq
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.freq
mudiff.mblacc.equalvar(len=0.2, alpha=2, beta=2)
mudiff.mblacc.equalvar(len=0.2, alpha=2, beta=2)
The function mudiff.mblalc
returns the required sample sizes
to reach a given posterior credible interval length on average for a fixed coverage probability - using a mixed Bayesian/likelihood approach - for the difference between two normal means.
mudiff.mblalc(len, alpha1, beta1, alpha2, beta2, level = 0.95, m = 10000, mcs = 3)
mudiff.mblalc(len, alpha1, beta1, alpha2, beta2, level = 0.95, m = 10000, mcs = 3)
len |
The desired average length of the posterior credible interval for the difference between the two unknown means |
alpha1 |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) for the first population |
beta1 |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) for the first population |
alpha2 |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) for the second population |
beta2 |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) for the second population |
level |
The desired fixed coverage probability of the posterior credible interval (e.g., 0.95) |
m |
The number of points simulated from the preposterior distribution of the data. For each point, the length of the highest posterior density interval of fixed coverage probability level is estimated, in order to approximate the average length. Usually 10000 is sufficient, but one can increase this number at the expense of program running time. |
mcs |
The Maximum number of Consecutive Steps allowed in the same direction in the march towards the optimal sample size, before the result for the next upper/lower bound is cross-checked. In our experience, mcs = 3 is a good choice. |
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means.
Assume that the precision within each of the two the populations are
unknown, but have prior information in the form of
Gamma(alpha1, beta1) and Gamma(alpha2, beta2) densities, respectively.
The function mudiff.mblalc
returns the required sample sizes to attain the
desired average length len for the posterior credible interval of fixed coverage probability level
for the difference between the two unknown means.
This function uses a Mixed Bayesian/Likelihood (MBL) approach.
MBL approaches use the prior information to derive the predictive distribution of the data, but use only the likelihood function for final inferences.
This approach is intended to satisfy investigators who recognize that prior information is important for planning purposes but prefer to base final inferences only on the data.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes are calculated via Monte Carlo simulations, and therefore may vary from one call to the next.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.mblacc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.freq
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.freq
mudiff.mblalc(len=0.2, alpha1=2, beta1=2, alpha2=3, beta2=3)
mudiff.mblalc(len=0.2, alpha1=2, beta1=2, alpha2=3, beta2=3)
The function mudiff.mblalc.equalvar
returns the required sample sizes
to reach a given posterior credible interval length on average for a fixed coverage probability for the difference between two normal means - using a mixed Bayesian/likelihood approach - when variances are equal.
mudiff.mblalc.equalvar(len, alpha, beta, level = 0.95)
mudiff.mblalc.equalvar(len, alpha, beta, level = 0.95)
len |
The desired average length of the posterior credible interval for the difference between the two unknown means |
alpha |
First prior parameter of the Gamma density for the common precision (reciprocal of the variance) |
beta |
Second prior parameter of the Gamma density for the common precision (reciprocal of the variance) |
level |
The desired fixed coverage probability of the posterior credible interval (e.g., 0.95) |
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means.
Assume that the precisions of the two normal sampling distributions are
unknown but equal, with prior information in the form of a Gamma(alpha,
beta) density.
The function mudiff.mblalc.equalvar
returns the required sample sizes to attain the
desired average length len for the posterior credible interval of fixed coverage probability level
for the difference between the two unknown means.
This function uses a Mixed Bayesian/Likelihood (MBL) approach.
MBL approaches use the prior information to derive the predictive distribution of the data, but use only the likelihood function for final inferences.
This approach is intended to satisfy investigators who recognize that prior information is important for planning purposes but prefer to base final inferences only on the data.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes returned by this function are exact.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.mblacc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mbl.varknown
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.varknown
, mudiff.freq
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.freq
mudiff.mblalc.equalvar(len=0.2, alpha=2, beta=2)
mudiff.mblalc.equalvar(len=0.2, alpha=2, beta=2)
The function mudiff.mblmodwoc
uses a mixed Bayesian/likelihood approach to
determine conservative sample sizes, in the sense that the desired posterior credible interval coverage and length
for the difference between two normal means are guaranteed
over a given proportion of data sets that can arise according to the prior information.
mudiff.mblmodwoc(len, alpha1, beta1, alpha2, beta2, level = 0.95, worst.level = 0.95, m = 50000, mcs = 3)
mudiff.mblmodwoc(len, alpha1, beta1, alpha2, beta2, level = 0.95, worst.level = 0.95, m = 50000, mcs = 3)
len |
The desired total length of the posterior credible interval for the difference between the two unknown means |
alpha1 |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) for the first population |
beta1 |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) for the first population |
alpha2 |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) for the second population |
beta2 |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) for the second population |
level |
The desired fixed coverage probability of the posterior credible interval (e.g., 0.95) |
worst.level |
The probability that the length of the posterior credible interval of fixed coverage probability level will be at most len |
m |
The number of points simulated from the preposterior distribution of the data. For each point, the length of the highest posterior density interval of fixed coverage probability level is estimated, in order to approximate the (100*worst.level)%-percentile of the posterior credible interval length. Usually 50000 is sufficient, but one can increase this number at the expense of program running time. |
mcs |
The Maximum number of Consecutive Steps allowed in the same direction in the march towards the optimal sample size, before the result for the next upper/lower bound is cross-checked. In our experience, mcs = 3 is a good choice. |
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means.
Assume that the precision within each of the two the populations are
unknown, but have prior information in the form of
Gamma(alpha1, beta1) and Gamma(alpha2, beta2) densities, respectively.
The function mudiff.mblmodwoc
returns the required sample sizes to attain the desired length len
for the posterior credible interval of fixed coverage probability level
for the difference between the two unknown means.
The Modified Worst Outcome Criterion used is conservative, in the sense that the posterior credible interval
length len is guaranteed over the worst.level proportion of all
possible data sets that can arise according to the prior information, for a fixed coverage probability level.
This function uses a Mixed Bayesian/Likelihood (MBL) approach.
MBL approaches use the prior information to derive the predictive distribution
of the data, but uses only the likelihood function for final inferences.
This approach is intended to satisfy investigators who recognize that prior
information is important for planning purposes but prefer to base final
inferences only on the data.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes are calculated via Monte Carlo simulations, and therefore may vary from one call to the next.
It is also correct to state that the coverage probability of the posterior credible interval of fixed length len will be at least level with probability worst.level with the sample sizes returned.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.mblacc
, mudiff.mblalc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.freq
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.freq
mudiff.mblmodwoc(len=0.2, alpha1=2, beta1=2, alpha2=3, beta2=3, worst.level=0.95)
mudiff.mblmodwoc(len=0.2, alpha1=2, beta1=2, alpha2=3, beta2=3, worst.level=0.95)
The function mudiff.mblmodwoc.equalvar
uses a mixed Bayesian/likelihood approach to
determine conservative sample sizes, in the sense that the desired posterior credible interval coverage and length
for the difference between two normal means are guaranteed over a given proportion of data sets that can arise according to the prior information, when variances are equal.
mudiff.mblmodwoc.equalvar(len, alpha, beta, level = 0.95, worst.level = 0.95, m = 50000, mcs = 3)
mudiff.mblmodwoc.equalvar(len, alpha, beta, level = 0.95, worst.level = 0.95, m = 50000, mcs = 3)
len |
The desired total length of the posterior credible interval for the difference between the two unknown means |
alpha |
First prior parameter of the Gamma density for the common precision (reciprocal of the variance) |
beta |
Second prior parameter of the Gamma density for the common precision (reciprocal of the variance) |
level |
The desired fixed coverage probability of the posterior credible interval (e.g., 0.95) |
worst.level |
The probability that the length of the posterior credible interval of fixed coverage probability level will be at most len |
m |
The number of points simulated from the preposterior distribution of the data. For each point, the length of the highest posterior density interval of fixed coverage probability level is estimated, in order to approximate the (100*worst.level)%-percentile of the posterior credible interval length. Usually 50000 is sufficient, but one can increase this number at the expense of program running time. |
mcs |
The Maximum number of Consecutive Steps allowed in the same direction in the march towards the optimal sample size, before the result for the next upper/lower bound is cross-checked. In our experience, mcs = 3 is a good choice. |
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means.
Assume that the precisions of the two normal sampling distributions are
unknown but equal, with prior information in the form of a Gamma(alpha,
beta) density.
The function mudiff.mblmodwoc.equalvar
returns the required sample sizes to attain the desired length len
for the posterior credible interval of fixed coverage probability level
for the difference between the two unknown means.
The Modified Worst Outcome Criterion used is conservative, in the sense that the posterior credible interval
length len is guaranteed over the worst.level proportion of all
possible data sets that can arise according to the prior information, for a fixed coverage probability level.
This function uses a Mixed Bayesian/Likelihood (MBL) approach.
MBL approaches use the prior information to derive the predictive distribution
of the data, but uses only the likelihood function for final inferences.
This approach is intended to satisfy investigators who recognize that prior
information is important for planning purposes but prefer to base final
inferences only on the data.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes are calculated via Monte Carlo simulations, and therefore may vary from one call to the next.
It is also correct to state that the coverage probability of the posterior credible interval of fixed length len will be at least level with probability worst.level with the sample sizes returned.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mbl.varknown
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.varknown
, mudiff.freq
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.freq
mudiff.mblmodwoc.equalvar(len=0.2, alpha=2, beta=2)
mudiff.mblmodwoc.equalvar(len=0.2, alpha=2, beta=2)
The function mudiff.modwoc
calculates conservative sample sizes, in the sense that the desired
posterior credible interval coverage and length for the difference between two normal means
are guaranteed over a given proportion of data sets that can arise according to the prior information.
mudiff.modwoc(len, alpha1, beta1, alpha2, beta2, n01, n02, level = 0.95, worst.level = 0.95, equal = TRUE, m = 50000, mcs = 3)
mudiff.modwoc(len, alpha1, beta1, alpha2, beta2, n01, n02, level = 0.95, worst.level = 0.95, equal = TRUE, m = 50000, mcs = 3)
len |
The desired total length of the posterior credible interval for the difference between the two unknown means |
|||||||||
alpha1 |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) for the first population |
|||||||||
beta1 |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) for the first population |
|||||||||
alpha2 |
First prior parameter of the Gamma density for the precision (reciprocal of the variance) for the second population |
|||||||||
beta2 |
Second prior parameter of the Gamma density for the precision (reciprocal of the variance) for the second population |
|||||||||
n01 |
Prior sample size equivalent for the mean for the first population |
|||||||||
n02 |
Prior sample size equivalent for the mean for the second population |
|||||||||
level |
The desired fixed coverage probability of the posterior credible interval (e.g., 0.95) |
|||||||||
worst.level |
The probability that the length of the posterior credible interval of fixed coverage probability level will be at most len |
|||||||||
equal |
logical. Whether or not the final group sizes (n1, n2) are forced to be equal:
|
|||||||||
m |
The number of points simulated from the preposterior distribution of the data. For each point, the length of the highest posterior density interval of fixed coverage probability level is estimated, in order to approximate the (100*worst.level)%-percentile of the posterior credible interval length. Usually 50000 is sufficient, but one can increase this number at the expense of program running time. |
|||||||||
mcs |
The Maximum number of Consecutive Steps allowed in the same direction in the march towards the optimal sample size, before the result for the next upper/lower bound is cross-checked. In our experience, mcs = 3 is a good choice. |
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means.
Assume that the precision within each of the two the populations are
unknown, but have prior information in the form of
Gamma(alpha1, beta1) and Gamma(alpha2, beta2) densities, respectively.
Assume that the means are unknown, but have
prior information equivalent to (n01, n02) previous observations, respectively.
The function mudiff.modwoc
returns the required sample sizes to attain
the desired length len for the posterior credible interval of fixed coverage probability level
for the difference between the two unknown unknown means.
The Modified Worst Outcome Criterion used is conservative, in the sense that the posterior credible interval
length len is guaranteed over the worst.level proportion of all
possible data sets that can arise according to the prior information, for a fixed coverage probability level.
This function uses a fully Bayesian approach to sample size determination.
Therefore, the desired coverages and lengths are only realized if the prior distributions input to the function
are used for final inferences. Researchers preferring to use the data only for final inferences are encouraged
to use the Mixed Bayesian/Likelihood version of the function.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes are calculated via Monte Carlo simulations, and therefore may vary from one call to the next.
It is also correct to state that the coverage probability of the posterior credible interval of fixed length len will be at least level with probability worst.level with the sample sizes returned.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.acc
, mudiff.alc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.varknown
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mbl.varknown
, mudiff.freq
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.freq
mudiff.modwoc(len=0.2, alpha1=2, beta1=2, alpha2=3, beta2=3, n01=10, n02=50)
mudiff.modwoc(len=0.2, alpha1=2, beta1=2, alpha2=3, beta2=3, n01=10, n02=50)
The function mudiff.modwoc.equalvar
calculates conservative sample sizes, in the sense that the desired
posterior credible interval coverage and length for the difference between two normal means
are guaranteed over a given proportion of data sets that can arise according to the prior information, when variances are equal.
mudiff.modwoc.equalvar(len, alpha, beta, n01, n02, level = 0.95, worst.level = 0.95, equal = TRUE)
mudiff.modwoc.equalvar(len, alpha, beta, n01, n02, level = 0.95, worst.level = 0.95, equal = TRUE)
len |
The desired total length of the posterior credible interval for the difference between the two unknown means |
|||||||||
alpha |
First prior parameter of the Gamma density for the common precision (reciprocal of the variance) |
|||||||||
beta |
Second prior parameter of the Gamma density for the common precision (reciprocal of the variance) |
|||||||||
n01 |
Prior sample size equivalent for the mean for the first population |
|||||||||
n02 |
Prior sample size equivalent for the mean for the second population |
|||||||||
level |
The desired fixed coverage probability of the posterior credible interval (e.g., 0.95) |
|||||||||
worst.level |
The probability that the length of the posterior credible interval of fixed coverage probability level will be at most len |
|||||||||
equal |
logical. Whether or not the final group sizes (n1, n2) are forced to be equal:
|
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means.
Assume that the precisions of the two normal sampling distributions are
unknown but equal, with prior information in the form of a Gamma(alpha,
beta) density. Assume that the means are unknown, but have
prior information equivalent to (n01, n02) previous observations, respectively.
The function mudiff.modwoc.equalvar
returns the required sample sizes to attain the desired length len
for the posterior credible interval of fixed coverage probability level
for the difference between the two unknown means.
The Modified Worst Outcome Criterion used is conservative, in the sense that the posterior credible interval
length len is guaranteed over the worst.level proportion of all
possible data sets that can arise according to the prior information, for a fixed coverage probability level.
This function uses a fully Bayesian approach to sample size determination.
Therefore, the desired coverages and lengths are only realized if the prior distributions input to the function
are used for final inferences. Researchers preferring to use the data only for final inferences are encouraged
to use the Mixed Bayesian/Likelihood version of the function.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes returned by this function are exact.
It is also correct to state that the coverage probability of the posterior credible interval of fixed length len will be at least level with probability worst.level with the sample sizes returned.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.varknown
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mbl.varknown
, mudiff.freq
, mu.acc
, mu.alc
, mu.modwoc
, mu.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.mbl.varknown
, mu.freq
mudiff.modwoc.equalvar(len=0.2, alpha=2, beta=2, n01=10, n02=50)
mudiff.modwoc.equalvar(len=0.2, alpha=2, beta=2, n01=10, n02=50)
The function mudiff.varknown
returns the required sample sizes
to reach a given posterior credible interval length and coverage probability for the difference between two normal means, when variances are known.
mudiff.varknown(len, lambda1, n01, lambda2, n02, level = 0.95, equal = TRUE)
mudiff.varknown(len, lambda1, n01, lambda2, n02, level = 0.95, equal = TRUE)
len |
The desired total length of the posterior credible interval for the difference between the two unknown means |
|||||||||
lambda1 |
The known precision (reciprocal of variance) for the first population |
|||||||||
n01 |
Prior sample size equivalent for the mean for the first population |
|||||||||
lambda2 |
The known precision (reciprocal of variance) for the second population |
|||||||||
n02 |
Prior sample size equivalent for the mean for the second population |
|||||||||
level |
The desired coverage probability of the posterior credible interval (e.g., 0.95) |
|||||||||
equal |
logical. Whether or not the final group sizes (n1, n2) are forced to be equal:
|
Assume that a sample from each of two populations will be
collected in order to estimate the difference between two independent normal means
when the variances are known. Assume that the means are unknown, but have
prior information equivalent to (n01, n02) previous observations, respectively. The function
mudiff.varknown
returns the required sample sizes to attain the
desired length len and coverage probability level for the posterior credible interval
for the difference between the two unknown means.
This function uses a fully Bayesian approach to sample size determination.
Therefore, the desired coverages and lengths are only realized if the prior distributions input to the function
are used for final inferences. Researchers preferring to use the data only for final inferences are encouraged
to use the Mixed Bayesian/Likelihood version of the function.
The required sample sizes (n1, n2) for each group given the inputs to the function.
The sample sizes returned by this function are exact.
Lawrence Joseph [email protected] and Patrick Bélisle
Joseph L, Bélisle P.
Bayesian sample size determination for Normal means and differences between Normal means
The Statistician 1997;46(2):209-226.
mudiff.acc
, mudiff.alc
, mudiff.modwoc
, mudiff.acc.equalvar
, mudiff.alc.equalvar
, mudiff.modwoc.equalvar
, mudiff.mbl.varknown
, mudiff.mblacc
, mudiff.mblalc
, mudiff.mblmodwoc
, mudiff.mblacc.equalvar
, mudiff.mblalc.equalvar
, mudiff.mblmodwoc.equalvar
, mudiff.freq
, mu.varknown
, mu.acc
, mu.alc
, mu.modwoc
, mu.mbl.varknown
, mu.mblacc
, mu.mblalc
, mu.mblmodwoc
, mu.freq
mudiff.varknown(len=0.2, lambda1=1, n01=10, lambda2=1/1.5, n02=25)
mudiff.varknown(len=0.2, lambda1=1, n01=10, lambda2=1/1.5, n02=25)