sim.seqtest.cor: Simulation of the sequential triangular test for the...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

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

Usage

1
2
3
4
5
sim.seqtest.cor(rho.sim, k, rho,
                alternative = c("two.sided", "less", "greater"),
                delta, alpha = 0.05, beta = 0.1, runs = 1000,
                m.x = 0,  sd.x = 1, m.y = 0, sd.y = 1,
                digits = 3, output = TRUE, plot = FALSE)

Arguments

rho.sim

simulated population correlation coefficient, ρ.

k

an integer or a numerical vector indicating the number of observations in each sub-sample.

rho

a number indicating the correlation under the null hypothesis, ρ0.

alternative

a character string specifying the alternative hypothesis,

delta

minimum difference to be detected, δ.

alpha

type-I-risk, α.

beta

an integer or a numerical vector indicating the type-II-risk, β.

runs

numer of simulation runs.

m.x

population mean of simulated vector x.

sd.x

population standard deviation of simulated vector x.

m.y

population mean of simulated vector y.

sd.y

population standard deviation of simulated vector y.

digits

integer indicating the number of decimal places to be displayed.

output

logical: if TRUE, output is shown.

plot

logical: if TRUE, plot is shown.

Details

In order to determine the optimal k, simulation is conducted under the H0 condition, i.e., rho.sim = rho. Simulation is carried out for a sequence of k values to seek for the optimal k where the empirical alpha is as close as possible to the nominal alpha. In order to determine optimal beta (with fixed k), simulation is conudcted under the H1 condition, i.e., rho.sim = rho + delta or rho.sim = rho - delta. Simulation is carried out for a sequencen of beta values to seek for the optimal beta where the empirical beta is as close as possible to the nominal beta.

In order to specify a one-sided test, argument alternative has to be used (i.e., two-sided tests are conducted by default). Specifying argument alternative = "less" conducts the simulation for the null hypothesis, H0: ρ >= ρ.0 with the alternative hypothesis, H1: ρ < ρ.0; specifying argument alternative = "greater" conducts the simluation for the null hypothesis, H0: ρ <= ρ.0 with the alternative hypothesis, H1: ρ > ρ.0.

Value

Returns an object of class sim.seqtest.cor with following entries:

call function call
spec specification of function arguments
simres list with results (for each k or beta) for each run
res data.frame with results, i.e., k, alpha.nom (nominal alpha), alpha.emp (estimated empirical alpha), beta.nom (nominal beta), beta.emp (empirica beta), p.H0 (proportion decision = H0), p.H1 (proportion decision = H1), AVN (average number of V), ASN (average number of sample pairs)

Author(s)

Takuya Yanagida takuya.yanagida@univie.ac.at,

References

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

See Also

seqtest.cor, plot.sim.seqtest.cor, print.sim.seqtest.cor

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
#---------------------------------------------
# Determine optimal k and nominal type-II-risk
# H0: rho <= 0.3, H1: rho > 0.3
# alpha = 0.01, beta = 0.05, delta = 0.25

# Step 1: Determine the optimal size of subsamples (k)

sim.seqtest.cor(rho.sim = 0.3, k = seq(4, 16, by = 1), rho = 0.3,
                alternative = "greater",
                delta = 0.25, alpha = 0.05, beta = 0.05,
                runs = 10000, plot = TRUE)

# Step 2: Determine the optimal nominal type-II-risk based on
#         the optimal size of subsamples (k) from step 1

sim.seqtest.cor(rho.sim = 0.55, k = 16, rho = 0.3,
                alternative = "greater",
                delta = 0.25, alpha = 0.05, beta = seq(0.05, 0.15, by = 0.01),
                runs = 10000, plot = TRUE)

## End(Not run)

miscor documentation built on May 1, 2019, 10:14 p.m.