p_mauchly.test {Spower} | R Documentation |
p-value from Mauchly's Test of Sphericity simulation
Description
Perform simulation experiment for Mauchly's Test of Sphericity using
the function mauchlys.test
, returning a p-value.
Assumes the data are from a multivariate
normal distribution, however this can be modified.
Usage
p_mauchly.test(n, sigma, gen_fun = gen_mauchly.test, ...)
gen_mauchly.test(n, sigma, ...)
mauchlys.test(X)
Arguments
n |
sample size |
sigma |
symmetric covariance/correlation matrix passed to |
gen_fun |
function used to generate the required data.
Object returned must be a |
... |
additional arguments to be passed to |
X |
a matrix with |
Value
a single p-value
Author(s)
Phil Chalmers rphilip.chalmers@gmail.com
Examples
sigma <- diag(c(1,2,1))
sigma
p_mauchly.test(100, sigma=sigma)
# Null is true
sigma.H0 <- diag(3)
p_mauchly.test(100, sigma=sigma.H0)
# empirical power estimate
p_mauchly.test(100, sigma=sigma) |> Spower()
# empirical Type I error estimate
p_mauchly.test(100, sigma=sigma.H0) |> Spower()
[Package Spower version 0.2.3 Index]