Description Usage Arguments Details Value See Also Examples
These functions implement testing procedures for the mean of populations of
vectors or functions. In particular, when the optional parameter B =
0
, a parametric test based on Hotelling's statistic is used, while, if
B > 0
, a permutation test is instead used and more statistics can be
chosen by the user. The parametric test assumes that the data is normally
distributed or that the sample size is large such that the central limit
theorem can be applied. The permutation test assumes that the distribution
from which the data come is symmetric.
1 2 3 4 5 | test_onesample(x, mu = 0, step_size = 0, B = 1000,
statistic = "Hotelling", verbose = TRUE, skip_check = FALSE)
test_twosample(x, y, mu = 0, paired = FALSE, step_size = 0, B = 1000,
statistic = "Hotelling", verbose = TRUE, skip_check = FALSE)
|
x |
Dataframe or matrix containing the data collected from 1st population. |
mu |
True mean value (or difference between mean values) under the null
hypothesis (default = |
step_size |
The step size used to perform integral approximation via the
method of rectangles (default: |
B |
Number of bootstrap permutations (default: 1000). |
statistic |
Statistic to be used within the permutation framework. Choices are Hotelling (default), L1, L2, Linf, StandardizedL1, StandardizedL2, StandardizedLinf and All. |
verbose |
Activate verbose (default: |
skip_check |
Flag to skip checks on input types. Default is off. This
parameter should always be set to its default |
y |
Dataframe or matrix containing the data collected from 2nd
population (default: |
paired |
Is the input data paired? (default: |
All the statistics of the fdahotelling package can be used with the permutation version of this test. In addition, the user can implement its own statistic to be used with the test, provided that:
the
user-defined statistic takes the same input arguments as the ones in the
fdahotelling package, i.e., the mandatory first dataset x
, the
optional second dataset y
and the mean function under the null
hypothesis mu
that can have a default value,
high values of the statistic yield rejection of the null hypothesis.
A 3-column tibble
containing the names of the
required statistics and their values, along with an estimate of the p-value
of the corresponding statistical test.
The parametric test is described in details in Secchi, P., Stamm, A., & Vantini, S. (2013). Inference for the mean of large p small n data: A finite-sample high-dimensional generalization of Hotelling theorem. Electronic Journal of Statistics, 7, pp. 2005-2031. doi:10.1214/13-EJS833, available online at http://projecteuclid.org/euclid.ejs/1375708877. The permutation test is described in details in the technical report by Pini, A., Stamm, A., & Vantini, S. (2015). Hotelling T^2 in functional Hilbert spaces, available online at https://mox.polimi.it/publication-results/?id=524&tipo=add_qmox.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ####################
# One-Sample Tests #
####################
x <- aneurisk %>%
dplyr::filter(variable == "curvature" & group == "low") %>%
dplyr::select(data) %>%
purrr::flatten_df()
# Parametric test
test_onesample(x = x, mu = 0, step_size = 0.01, B = 0)
# Permutation test
test_onesample(x = x, mu = 0, step_size = 0.01, B = 100)
####################
# Two-Sample Tests #
####################
y <- aneurisk %>%
dplyr::filter(variable == "curvature" & group == "up") %>%
dplyr::select(data) %>%
purrr::flatten_df()
# Parametric test
test_twosample(x = x, y = y, mu = 0, step_size = 0.01, B = 0)
# Permutation test
test_twosample(x = x, y = y, mu = 0, step_size = 0.01, B = 100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.