type2.error.oneT: Type 2 error function of one-sample T-tests in a fixed design
Description
For a one-sample T-test in a fixed design, this function evaluates (Type 2 error - a constant) at a specified alternative value of population mean.
Usage
type2.error.oneT(alt, side = "right", null = 0, n, type1 = 0.005, root = 0)
Arguments
alt
a numeric; the value of population mean (consistent with side) where the Type 2 error of the fixed design test needs to be evaluated at.
side
a character; direction of the alternative hypothesis H1.
Has to be one of "right" or "left".
Default:"right".
null
a numeric; the hypothesized value of population mean under a simple null hypothesis.
Default:0.
n
a positive numeric (integer); sample size to be used.
type1
a numeric in (0,1); prespecified Type 1 error probability.
Default:0.005.
root
a numeric; when this is 0, the Type 2 error is returned;
in general, (Type 2 error - root) is returned
Default:0.
Value
If root=k, a numeric (Type 2 error - k) evaluated at the speified alternative value alt is returned.
Details
In case of one-sample T-tests in a fixed design, this function evaluates the Type 2 error at a specified value alt. We can also use this function to do the other way round by exploiting the argument root; that is, given a Type 2 error \(\beta\), we can obtain the alt where Type 2 error equals \(\beta\). To do that, we need to substitute root=\(\beta\) in the argument of this function, and then solve it for alt. The function find.alt() in this package excatly does this.
# NOT RUN {## Type 2 error at an alternative valuetype2.error.oneT(alt= 1.2, n= 60)
## (Type 2 error - 0.5) at the same alternative valuetype2.error.oneT(alt= 1.2, n= 60, root = 0.5)
# }