Learn R Programming

miscor (version 0.1-0)

seqtest.cor: Sequential triangular test for the product-moment correlation coefficient

Description

This function performs the sequential triangular test for the product-moment correlation coefficient

Usage

seqtest.cor(x, k, rho, delta, alternative = c("two.sided", "less", "greater"), alpha = 0.05, beta = 0.1, output = TRUE, plot = FALSE)

Arguments

x
initial data, i.e., product-moment correlation coefficient in a sub-sample of k observations.
k
number of observations in each sub-sample.
rho
a number indicating the correlation under the null hypothesis, $\rho$0.
delta
minimum difference to be detected, $\delta$.
alternative
a character string specifying the alternative hypothesis,
alpha
type-I-risk, $\alpha$.
beta
type-II-risk, $\beta$.
output
logical: if TRUE, output is shown.
plot
logical: if TRUE, an initial plot is generated.

Value

Returns an object of class seqtest, to be used for later update steps. The object has following entries:
call
function call
type
type of the test (i.e., correlation coefficient)
spec
specification of function arguments
tri
specification of triangular
dat
data
res
list with results

Details

Null and alternative hypothesis is specified using arguments rho and delta. Note that the argument k (i.e., number of observations in each sub-sample) has to be specified. At least k = 4 is needed. The optimal value of k should be determined based on statistical simulation using sim.seqtest.cor function.

In order to specify a one-sided test, argument alternative has to be used (i.e., two-sided tests are conducted by default). That is, alternative = "less" specifies the null hypothesis, H0: $\rho$ >= $\rho$0 and the alternative hypothesis, H1: $\rho$ < $\rho$0; alternative = "greater" specifies the null hypothesis, H0: $\rho$ <= $\rho$0="" and="" the="" alternative="" hypothesis,="" h1:="" $\rho$=""> $\rho$0.

The main characteristic of the sequential triangular test is that there is no fixed sample size given in advance. That is, for the most recent sampling point, one has to decide whether sampling has to be continued or either the null- or the alternative hypothesis can be accepted given specified precision requirements (i.e. type-I-risk, type-II-risk and an effect size). The sequence of data pairs must we split into sub-samples of length k >= 4 each. The (cumulative) test statistic Z.m on a Cartesian coordinate system produces a "sequential path" on a continuation area as a triangle. As long as the statistic remains within that triangle, additional data have to be sampled. If the path touches or exceeds the borderlines of the triangle, sampling is completed. Depending on the particular borderline, the null-hypothesis is either accepted or rejected.

References

Schneider, B., Rasch, D., Kubinger, K. D., & Yanagida, T. (2015). A Sequential triangular test of a correlation coefficient's null-hypothesis: 0 $< \rho \le \rho$0. Statistical Papers, 56, 689-699.

See Also

update.seqtest, sim.seqtest.cor

Examples

Run this code
#--------------------------------------
# H0: rho = 0.3, H1: rho != 0.3
# alpha = 0.05, beta = 0.2, delta = 0.2

seq.obj <- seqtest.cor(0.46, k = 14, rho = 0.3, delta = 0.2,
                       alpha = 0.05, beta = 0.2, plot = TRUE)

seq.obj <- update(seq.obj, c(0.56, 0.76, 0.56, 0.52))

#--------------------------------------
# H0: rho <= 0.3, H1: rho > 0.3
# alpha = 0.05, beta = 0.2, delta = 0.2

seq.obj <- seqtest.cor(0.46, k = 14, rho = 0.3, delta = 0.2,
                       alternative = "greater",
                       alpha = 0.05, beta = 0.2, plot = TRUE)

seq.obj <- update(seq.obj, c(0.56, 0.76, 0.66))

Run the code above in your browser using DataLab