safeZTest | R Documentation |
Safe one and two sample z-tests on vectors of data. The function is modelled after t.test()
.
safeZTest( x, y = NULL, paired = FALSE, designObj = NULL, pilot = FALSE, ciValue = NULL, tol = 1e-05, na.rm = FALSE, ... ) safe.z.test( x, y = NULL, paired = FALSE, designObj = NULL, pilot = FALSE, tol = 1e-05, ... )
x |
a (non-empty) numeric vector of data values. |
y |
an optional (non-empty) numeric vector of data values. |
paired |
a logical indicating whether you want the paired z-test. |
designObj |
an object obtained from |
pilot |
a logical indicating whether a pilot study is run. If |
ciValue |
numeric is the ciValue-level of the confidence sequence. Default ciValue=NULL, and ciValue = 1 - alpha |
tol |
numeric > 0, only used if pilot equals |
na.rm |
a logical value indicating whether |
... |
further arguments to be passed to or from methods. |
Returns an object of class 'safeTest'. An object of class 'safeTest' is a list containing at least the following components:
the value of the test statistic. Here the z-statistic.
The realised sample size(s).
the e-value of the safe test.
To be implemented: a safe confidence interval for the mean appropriate to the specific alternative hypothesis.
the estimated mean or difference in means or mean difference depending on whether it was a one- sample test or a two-sample test.
the specified hypothesised value of the mean or mean difference depending on whether it was a one-sample or a two-sample test.
any of "oneSample", "paired", "twoSample" effectively provided by the user.
a character string giving the name(s) of the data.
an object of class "safeDesign" described in designSafeZ()
.
the expression with which this function is called.
designObj <- designSafeZ(meanDiffMin=0.6, alpha=0.008, alternative="greater", testType="twoSample", ratio=1.2) set.seed(1) x <- rnorm(100) y <- rnorm(100) safeZTest(x, y, designObj=designObj) # safeZTest(1:10, y = c(7:20), pilot=TRUE, alternative="less") # s = 7.7543e+20 > 1/alpha
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.