tests: Inference on the Mean for Multivariate and Functional Data

Description Usage Arguments Details Value See Also Examples

Description

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.

Usage

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)

Arguments

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 = 0).

step_size

The step size used to perform integral approximation via the method of rectangles (default: 0). When set to 0, it assumes that we are dealing with multivariate data rather than functional data and thus no integration is necessary.

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: TRUE).

skip_check

Flag to skip checks on input types. Default is off. This parameter should always be set to its default FALSE. It is set to TRUE only internally, in power calculation functions, in which data generated by the hypothesized model is already in matrix form.

y

Dataframe or matrix containing the data collected from 2nd population (default: NULL).

paired

Is the input data paired? (default: FALSE).

Details

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:

Value

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.

See Also

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.

Examples

 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)

astamm/fdahotelling documentation built on May 10, 2019, 2:05 p.m.