UMPBT.alt {MSPRT} | R Documentation |
UMPBT alternative
Description
Given a sample size and prespecified Type I & II error probabilities, this function obtains the objective alternative in the Uniformly Most Powerful Bayesian Test (UMPBT).
Usage
UMPBT.alt(test.type, side = "right", theta0,
N, N1, N2, Type1 = 0.005,
sigma = 1, sigma1 = 1, sigma2 = 1,
obs, sd.obs, obs1, obs2, pooled.sd)
Arguments
test.type |
Character. Type of test. Currently, the package only allows
|
side |
Character. Direction of the composite alternative hypothesis. |
theta0 |
Numeric. Hypothesized value of effect size ( |
N |
Positive integer. Sample size in one-sample tests. |
N1 |
Positive integer. Sample size from Group-1 in two-sample tests. |
N2 |
Positive integer. Sample size from Group-2 in two-sample tests. |
Type1 |
Numeric in [0,1]. Prespecified Type I error probability. Default: 0.005. |
sigma |
Positive numeric. Known standard deviation in one-sample z tests. Default: 1. |
sigma1 |
Positive numeric. Known standard deviation for Group-1 in two-sample z tests. Default: 1. |
sigma2 |
Positive numeric. Known standard deviation for Group-2 in two-sample z tests. Default: 1. |
obs |
Numeric vector. The vector of observations based on which the UMPBT alternative in one-sample t test is determined. Either |
sd.obs |
Positive numeric. The standard deviation (with divisor n-1) of observations based on which the UMPBT alternative in one-sample t test is determined. Either |
obs1 |
Numeric vector. The vector of observations from Group-1 based on which the UMPBT alternative in two-sample t test is determined. Either both |
obs2 |
Numeric vector. The vector of observations from Group-2 based on which the UMPBT alternative in two-sample t test is determined. Either both |
pooled.sd |
Positive numeric. The pooled standard deviation of observations from Group-1 and 2 based on which the UMPBT alternative in two-sample t test is determined. Either both |
Value
List with two named components theta
and mix.prob
in one-sample proportion test. In this case, the UMPBT alternative is a mixture distribution of two points. theta
contains the two points (effect sizes) and mix.prob
contains their respective mixing probabilities.
Numeric in case of all the other tests. It is the UMPBT alternative effect size.
Author(s)
Sandipan Pramanik, Valen E. Johnson and Anirban Bhattacharya
References
Johnson, V. E. (2013a). Revised standards for statistical evidence.Proceed-ings of the National Academy of Sciences, 110(48):19313-19317. [Article]
Johnson, V. E. (2013b). Uniformly most powerful Bayesian tests.TheAnnals of Statistics, 41(4):1716-1741. [Article]
Pramanik S., Johnson V. E. and Bhattacharya A. (2020+). A Modified Sequential Probability Ratio Test. [Arxiv]
Examples
##### one-sample proportion test #####
## right-sided
UMPBT.alt(test.type = "oneProp", N = 30)
## left-sided
UMPBT.alt(side = "left", test.type = "oneProp", N = 30)
##### one-sample z test #####
## right-sided
UMPBT.alt(test.type = "oneZ", N = 30)
## left-sided
UMPBT.alt(side = "left", test.type = "oneZ", N = 30)
##### one-sample t test #####
## observed data
set.seed(1)
x = rnorm(n = 30, mean = 0, sd = 1.5)
## right-sided
UMPBT.alt(test.type = "oneT", N = 30, obs = x)
## left-sided
UMPBT.alt(side = "left", test.type = "oneT", N = 30, obs = x)
##### two-sample z test #####
## right-sided
UMPBT.alt(test.type = "twoZ", N1 = 30, N2 = 30)
## left-sided
UMPBT.alt(side = "left", test.type = "twoZ", N1 = 30, N2 = 30)
##### two-sample t test #####
## observed data
set.seed(1)
x1 = rnorm(n = 30, mean = 0, sd = 1.5)
x2 = rnorm(n = 30, mean = 0, sd = 1.5)
## right-sided
UMPBT.alt(test.type = "twoT", N1 = 30, N2 = 30,
obs1 = x1, obs2 = x2)
## left-sided
UMPBT.alt(side = "left", test.type = "twoT", N1 = 30, N2 = 30,
obs1 = x1, obs2 = x2)