Description Usage Arguments Value Author(s) References Examples
Given the maximum available sample size and prespecified Type I & II error probabilities, this function designs/obtains the corresponding MSPRT.
1 2 3 4 5 6 | design.MSPRT(test.type, side = "right", theta0, theta1 = T,
Type1.target = 0.005, Type2.target = 0.2,
N.max, N1.max, N2.max,
sigma = 1, sigma1 = 1, sigma2 = 1,
batch.size, batch1.size, batch2.size,
nReplicate = 1e+06, verbose = T, seed = 1)
|
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 (θ_0) under H_0. Default: 0.5 in one-sample proportion tests, and 0 for others. |
theta1 |
Logical, numeric or list (two components with names
Note: In case of two-sided tests at a given level of significance, there are two effect sizes under H_1 (one on the right of H_0 and one on the left) that corresponds to the same Type II error probability (or power). This list provides users with the ability where he/she can replace θ_1 and θ_2 by any effect sizes from each side in the form of a list as mentioned above, and can get the designed MSPRT together with its operating characteristics at those effect sizes. |
Type1.target |
Numeric within [0,1]. Prespecified level of Type I error probability. Default: 0.005. The MSPRT exactly maintains its Type I error probability at this value. |
Type2.target |
Numeric within [0,1]. Prespecified level of Type 2 error probability. Default: 0.2. The MSPRT approximately maintains its Type II error probability at this value at the corresponding fixed-design alternative (θ_a). |
N.max |
Positive integer. Maximum available sample size in one-sample tests. |
N1.max |
Positive integer. Maximum available sample size from Group-1 in two-sample tests. |
N2.max |
Positive integer. Maximum available sample size from Group-2 in two-sample tests. |
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. |
batch.size |
Integer vector. A vector denoting the number of observations that are planned to be observed at each sequential step in one-sample tests. Default:
Default values mean the sequential analysis is performed after observing each observation. This corresponds to a sequential MSPRT. If any batch size is more than 1 (or more than 2 in the 1st step for t test) it corresponds to a group sequential MSPRT. Note: First batch size for t tests needs to be at least 2. The length of batch.size equals to the maximum number of planned sequential analyses. |
batch1.size |
Integer vector. A vector denoting the number of observations that are planned to be observed from Group-1 at each sequential step in two-sample tests. Default:
Default values mean the sequential analysis is performed after observing each observation from Group-1. |
batch2.size |
Integer vector. A vector denoting the number of observations that are planned to be observed from Group-2 at each sequential step in two-sample tests. Default:
Default values mean the sequential analysis is performed after observing each observation from Group-2. |
nReplicate |
Positive integer. Total number of replications to be used in Monte Carlo simulation for calculating the termination threshold and the operating characteristics of the MSPRT. Default: 1,000,000. |
verbose |
Logical. If |
seed |
Integer. Random number generating seed. Default: 1. |
List. The list has the following named components in case of one-sided one-sample tests:
TypeI.attained |
Numeric in [0,1]. Type I error probability attained by the designed MSPRT. |
Type2.attained |
Numeric in [0,1]. Type II error probability attained by the designed MSPRT at the specified alternative effect size |
N |
List.
|
EN |
Numeric vector.
|
UMPBT or theta.UMPBT |
The UMPBT alternative. Note: Not returned in t tests as it depends on the data. |
theta1 |
Returned only if |
Type2.fixed.design |
Numeric in [0,1]. Type II error probability attained by the fixed design test with sample size |
RejectH0.threshold |
Positive numeric. Threshold for rejecting H_0 in the MSPRT. |
RejectH1.threshold |
Positive numeric. Threshold for accepting H_1 in the MSPRT. |
termination.threshold |
Positive numeric. Termination threshold of the MSPRT. |
In case of one-sided two-sample tests the above components are returned with following modifications:
N: |
List.
|
EN |
List.
Each of the named components |
In case of two-sided tests the above components are returned with following modifications:
Type2.attained |
Numeric vector of length 2 with both elements in [0,1]. The first and second component is the Type II error probability of the MSPRT at the specified alternative effect sizes |
N |
This is the same as in one-sided tests if |
EN |
Numeric vector. The same as in one-sided tests if |
Additionally, the output list also contains the provided arguments of design.MSPRT, and
nAnalyses |
Positive integer. This is the maximum number of sequential analyses that is planned. This equals to the |
Sandipan Pramanik, Valen E. Johnson and Anirban Bhattacharya
Pramanik S., Johnson V. E. and Bhattacharya A. (2020+). A Modified Sequential Probability Ratio Test. [Arxiv]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | ##### one-sample proportion test #####
## right-sided
#design.MSPRT(test.type = 'oneProp', side = 'right',
# N.max = 20)
## left-sided
#design.MSPRT(test.type = 'oneProp', side = 'right',
# N.max = 20)
## two-sided
#design.MSPRT(test.type = 'oneProp', side = 'both',
# N.max = 20)
##### one-sample z test #####
## right-sided
#design.MSPRT(test.type = 'oneZ', side = 'right',
# N.max = 20)
## left-sided
#design.MSPRT(test.type = 'oneZ', side = 'right',
# N.max = 20)
## two-sided
#design.MSPRT(test.type = 'oneZ', side = 'both',
# N.max = 20)
##### one-sample t test #####
## right-sided
#design.MSPRT(test.type = 'oneT', side = 'right',
# N.max = 20)
## left-sided
#design.MSPRT(test.type = 'oneT', side = 'right',
# N.max = 20)
## two-sided
#design.MSPRT(test.type = 'oneT', side = 'both',
# N.max = 20)
##### two-sample z test #####
## right-sided
#design.MSPRT(test.type = 'twoZ', side = 'right',
# N1.max = 20, N2.max = 20)
## left-sided
#design.MSPRT(test.type = 'twoZ', side = 'left',
# N1.max = 20, N2.max = 20)
## two-sided
#design.MSPRT(test.type = 'twoZ', side = 'both',
# N1.max = 20, N2.max = 20)
##### two-sample t test #####
## right-sided
#design.MSPRT(test.type = 'twoT', side = 'right',
# N1.max = 20, N2.max = 20)
## left-sided
#design.MSPRT(test.type = 'twoT', side = 'left',
# N1.max = 20, N2.max = 20)
## two-sided
#design.MSPRT(test.type = 'twoT', side = 'both',
# N1.max = 20, N2.max = 20)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.