# graph.fanova: One-way graphical functional ANOVA In myllym/GET: Global Envelope Tests

## Description

One-way ANOVA tests for functional data with graphical interpretation

## Usage

 1 2 graph.fanova(nsim, curve_set, groups, variances = "equal", summaryfun, alpha = 0.05, n.aver = 1L, mirror = FALSE, saveperm = FALSE, ...) 

## Arguments

 nsim The number of random permutations. curve_set The original data (an array of functions) provided as a curve_set object (see create_curve_set) or a fdata object (see fdata). The curve set should include the argument values for the functions in the component r, and the observed functions in the component obs. groups The original groups (a factor vector representing the assignment to groups). variances Either "equal" or "unequal". If "unequal", then correction for unequal variances as explained in details will be done. summaryfun Possible values are "means" and "contrasts". See description for their meaning. alpha The significance level of the test. n.aver If variances = "unequal", there is a possibility to use variances smoothed by appying moving average to the estimated sample variances. n.aver determines how many values on each side do contribute (incl. value itself). mirror The complement of the argument circular of filter. saveperm Logical. If TRUE, then the functions from permutations are saved to the attribute simfuns. ... Additional parameters to be passed to rank_envelope.

## Details

This functions can be used to perform one-way graphical functional ANOVA tests described in Mrkvička et al. (2016).

The tests assume that there are J groups which contain n1, ..., nJ functions T_{ij}, i=1,...,J, j=1,...,nj. The functions should be given in the argument curve_set, and the groups in the argument groups. The tests assume that T_{ij}, i=1,...,n_j is an iid sample from a stochastic process with mean function μ_j and covariance function γ_j(s,t) for s,t in R and j = 1,..., J.

If you want to test the hypothesis

H0: μ_j(r) = 0, j=1,...,J,

then you should use the test function

T = (\bar{T}_1(r), \bar{T}_2(r), ..., \bar{T}_J(r))

where \bar{T}_i(r) is a vector of mean values of functions in the group j. This can be done by choosing the summaryfun "means".

An alternative is to test the equivalent hypothesis

H0: μ_i(r) - μ_j(r) = 0, i=1,...,J-1, j=i,...,J.

This test corresponds to the post-hoc test done usually after an ANOVA test is significant, but it can be directed tested by mean of the combined rank test (Mrkvička et al., 2017), if the test vector is taken to consist of the differences of the group averages of test functions, namely

T' = (\bar{T}_1(r)-\bar{T}_2(r), \bar{T}_1(r)-\bar{T}_3(r), ..., \bar{T}_{J-1}(r)-\bar{T}_J(r)).

The summaryfun option "contrasts" can be used to perform the test based on this test vector.

The test as such assumes that the variances are equal across the groups of functions. To deal with unequal variances, the differences are rescaled as the first step as follows

S_{ij}(r) = ( T_{ij}(r) - \bar{T}(r) ) / Sd(T_j(r)) * Sd(T(r)) + \bar{T}(r))

where \bar{T}(r) is the overall sample mean and Sd(T(r)) is the overall sample standard deviation. This scaling of the test functions can be obtained by giving the argument variances = "unequal".

## References

Mrkvička, T., Hahn, U. and Myllymäki, M. (2016) A one-way ANOVA test for functional data with graphical interpretation. arXiv:1612.03608 [stat.ME] (http://arxiv.org/abs/1612.03608)

Mrkvička, T., Myllymäki, M., and Hahn, U. (2017). Multiple Monte Carlo testing, with applications in spatial point processes. Statistics and Computing 27 (5): 1239-1255. doi:10.1007/s11222-016-9683-9

## Examples

 1 2 3 4 5 6 7 8 9 data(rimov) groups <- factor(c(rep(1, times=12), rep(2, times=12), rep(3, times=12))) # type = "erl" is passed to global_envelope_test to obtain the rank envelope based on # the extreme rank length ordering of the functions res <- graph.fanova(nsim=999, curve_set=rimov, groups=groups, summaryfun="means", type="erl") plot(res, separate_yaxes=FALSE) res2 <- graph.fanova(nsim=999, curve_set=rimov, groups=groups, summaryfun="contrasts", type="erl") plot(res2, separate_yaxes=TRUE) 

myllym/GET documentation built on Sept. 30, 2018, 5:49 a.m.