Description Usage Arguments Value Author(s) References Examples
Given the sample size that is available at a lower level of significance, this function calculates the sample size that is required for achieving a higher level of significance so that a desired level of Type II error probability is maintained at a desired effect size.
1 2 3 4 5 |
test.type |
Character. Type of test. Currently, the package only allows
|
N |
Positive integer. Sample size available at the lower level of significance in one-sample tests. |
N1 |
Positive integer. Sample size available from Group-1 at the lower level of significance in two-sample tests. |
N2 |
Positive integer. Sample size available from Group-2 at the lower level of significance in two-sample tests. |
N.increment |
Positive integer. Increment in sample size allowed while searching for the sample size that is required for achieving the higher level of significance. |
N1.increment |
Positive integer. Increment in sample size from Group-1 allowed while searching for the sample size that is required for achieving the higher level of significance. |
N2.increment |
Positive integer. Increment in sample size from Group-2 allowed while searching for the sample size that is required for achieving the higher level of significance. |
lower.signif |
Numeric within [0,1]. Lower level of significance. Default 0.05. |
higher.signif |
Numeric within [0,1]. Higher level of significance. Default: 0.005. |
theta0 |
Numeric. Hypothesized value of effect size (θ_0) under H_0. Default: 0.5 in one-sample proportion tests, and 0 for others. |
side |
Character. Direction of the composite alternative hypothesis. |
Type2.target |
Numeric within [0,1]. Prespecified level of Type 2 error probability. Default: 0.2. |
theta |
Numeric. Effect size value where |
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. |
plot.it |
Logical. If |
One-sample tests: Numeric. The required sample size.
Two-sample tests: Numeric vector of length 2. The first and second components store the sample sizes required respectively from Group 1 and 2 for achieving the higher level of significance.
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 | ##### one-sample proportion test #####
## right-sided
Nstar(test.type = "oneProp", N = 30)
## left-sided
Nstar(test.type = "oneProp", side = "left", N = 30)
##### one-sample z test #####
## right-sided
Nstar(test.type = "oneZ", N = 30)
## left-sided
Nstar(test.type = "oneZ", side = "left", N = 30)
##### one-sample t test #####
## right-sided
Nstar(test.type = "oneT", N = 30)
## left-sided
Nstar(test.type = "oneT", side = "left", N = 30)
##### two-sample z test #####
## right-sided
Nstar(test.type = "twoZ", N1 = 30, N2 = 30)
## left-sided
Nstar(test.type = "twoZ", side = "left", N1 = 30, N2 = 30)
##### two-sample t test #####
## right-sided
Nstar(test.type = "twoT", N1 = 30, N2 = 30)
## left-sided
Nstar(test.type = "twoT", side = "left", N1 = 30, N2 = 30)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.