Title: | Repeated Measures Functional Analysis of Variance |
---|---|
Description: | The provided package implements the statistical tests for the functional repeated measures analysis problem (Kurylo and Smaga, 2023, <arXiv:2306.03883>). These procedures enable us to verify the overall hypothesis regarding equality, as well as hypotheses for pairwise comparisons (i.e., post hoc analysis) of mean functions corresponding to repeated experiments. |
Authors: | Katarzyna Kurylo [aut], Lukasz Smaga [aut, cre] |
Maintainer: | Lukasz Smaga <ls@amu.edu.pl> |
License: | LGPL-2 | LGPL-3 | GPL-2 | GPL-3 |
Version: | 0.1.0 |
Built: | 2025-03-02 03:48:32 UTC |
Source: | https://github.com/cran/rmfanova |
The function pointwise_f_test_statistic()
calculates and draws the pointwise F-type test statistic.
pointwise_f_test_statistic( x, plot = TRUE, values = FALSE, type = "l", ylab = "", main = "F(t)", ... )
pointwise_f_test_statistic( x, plot = TRUE, values = FALSE, type = "l", ylab = "", main = "F(t)", ... )
x |
a list of length |
plot |
a logical indicating of whether to draw the values of the pointwise F-type test statistic.
The default is |
values |
a logical indicating of whether to return the values of the pointwise F-type test statistic.
The default is |
type |
1-character string giving the type of plot desired, the same as in the |
ylab |
a label for the |
main |
a main title for the plot, the same as in the |
... |
other graphical parameters, the same as in the |
For details, see the documentation of the rmfanova()
function or
the paper Kurylo and Smaga (2023).
If values = TRUE
, a vector of values of the pointwise F-type test statistic.
Kurylo K., Smaga L. (2023) Functional repeated measures analysis of variance and its application. Preprint https://arxiv.org/abs/2306.03883
# preparation of the DTI data set, for details see Kurylo and Smaga (2023) library(refund) data(DTI) # MS patients DTI_ms <- DTI[DTI$case == 1, ] miss_data <- c() for (i in 1:340) if (any(is.na(DTI_ms$cca[i, ]))) miss_data <- c(miss_data, i) DTI_ms <- DTI_ms[-miss_data, ] DTI_ms_2 <- DTI_ms[DTI_ms$Nscans == 4, ] xx <- vector("list", 4) for (i in 1:4) { xx[[i]] <- DTI_ms_2$cca[DTI_ms_2$visit == i, ] } xx[[1]] <- xx[[1]][-14, ] xx[[3]] <- xx[[3]][-14, ] yy <- xx for (i in seq_len(4)) yy[[i]] <- yy[[i]][1:17, ] # pointwise F-type test statistic pointwise_f_test_statistic(yy, xlab = "t", xaxt = "n") axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93))
# preparation of the DTI data set, for details see Kurylo and Smaga (2023) library(refund) data(DTI) # MS patients DTI_ms <- DTI[DTI$case == 1, ] miss_data <- c() for (i in 1:340) if (any(is.na(DTI_ms$cca[i, ]))) miss_data <- c(miss_data, i) DTI_ms <- DTI_ms[-miss_data, ] DTI_ms_2 <- DTI_ms[DTI_ms$Nscans == 4, ] xx <- vector("list", 4) for (i in 1:4) { xx[[i]] <- DTI_ms_2$cca[DTI_ms_2$visit == i, ] } xx[[1]] <- xx[[1]][-14, ] xx[[3]] <- xx[[3]][-14, ] yy <- xx for (i in seq_len(4)) yy[[i]] <- yy[[i]][1:17, ] # pointwise F-type test statistic pointwise_f_test_statistic(yy, xlab = "t", xaxt = "n") axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93))
The function pointwise_sample_mean_fun()
calculates and draws the pointwise sample mean functions.
pointwise_sample_mean_fun( x, plot = TRUE, values = FALSE, type = "l", lty = 1, main = "Sample mean functions", ... )
pointwise_sample_mean_fun( x, plot = TRUE, values = FALSE, type = "l", lty = 1, main = "Sample mean functions", ... )
x |
a list of length |
plot |
a logical indicating of whether to draw the values of the pointwise sample mean functions.
The default is |
values |
a logical indicating of whether to return the values of the pointwise sample mean functions.
The default is |
type |
1-character string giving the type of plot desired, the same as in the |
lty |
vector of line types, the same as in the |
main |
a main title for the plot, the same as in the |
... |
other graphical parameters, the same as in the |
If values = TRUE
, a matrix of values of the pointwise sample mean functions.
Kurylo K., Smaga L. (2023) Functional repeated measures analysis of variance and its application. Preprint https://arxiv.org/abs/2306.03883
# preparation of the DTI data set, for details see Kurylo and Smaga (2023) library(refund) data(DTI) # MS patients DTI_ms <- DTI[DTI$case == 1, ] miss_data <- c() for (i in 1:340) if (any(is.na(DTI_ms$cca[i, ]))) miss_data <- c(miss_data, i) DTI_ms <- DTI_ms[-miss_data, ] DTI_ms_2 <- DTI_ms[DTI_ms$Nscans == 4, ] xx <- vector("list", 4) for (i in 1:4) { xx[[i]] <- DTI_ms_2$cca[DTI_ms_2$visit == i, ] } xx[[1]] <- xx[[1]][-14, ] xx[[3]] <- xx[[3]][-14, ] yy <- xx for (i in seq_len(4)) yy[[i]] <- yy[[i]][1:17, ] # sample mean functions oldpar <- par(mfrow = c(1, 1), mar = c(4, 4, 2, 0.1)) pointwise_sample_mean_fun(yy, values = FALSE, col = 1:4, xlab = "t", ylab = "FA", xaxt = "n") axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) legend(x = 36, y = 0.64, legend = 1:4, lty = 1, col = 1:4, title = "Visit") par(oldpar)
# preparation of the DTI data set, for details see Kurylo and Smaga (2023) library(refund) data(DTI) # MS patients DTI_ms <- DTI[DTI$case == 1, ] miss_data <- c() for (i in 1:340) if (any(is.na(DTI_ms$cca[i, ]))) miss_data <- c(miss_data, i) DTI_ms <- DTI_ms[-miss_data, ] DTI_ms_2 <- DTI_ms[DTI_ms$Nscans == 4, ] xx <- vector("list", 4) for (i in 1:4) { xx[[i]] <- DTI_ms_2$cca[DTI_ms_2$visit == i, ] } xx[[1]] <- xx[[1]][-14, ] xx[[3]] <- xx[[3]][-14, ] yy <- xx for (i in seq_len(4)) yy[[i]] <- yy[[i]][1:17, ] # sample mean functions oldpar <- par(mfrow = c(1, 1), mar = c(4, 4, 2, 0.1)) pointwise_sample_mean_fun(yy, values = FALSE, col = 1:4, xlab = "t", ylab = "FA", xaxt = "n") axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) legend(x = 36, y = 0.64, legend = 1:4, lty = 1, col = 1:4, title = "Visit") par(oldpar)
The function pointwise_ssa_test_statistic()
calculates and draws the pointwise SSA test statistic.
pointwise_ssa_test_statistic( x, plot = TRUE, values = FALSE, type = "l", ylab = "", main = "SSA(t)", ... )
pointwise_ssa_test_statistic( x, plot = TRUE, values = FALSE, type = "l", ylab = "", main = "SSA(t)", ... )
x |
a list of length |
plot |
a logical indicating of whether to draw the values of the pointwise SSA test statistic.
The default is |
values |
a logical indicating of whether to return the values of the pointwise SSA test statistic.
The default is |
type |
1-character string giving the type of plot desired, the same as in the |
ylab |
a label for the |
main |
a main title for the plot, the same as in the |
... |
other graphical parameters, the same as in the |
For details, see the documentation of the rmfanova()
function or
the paper Kurylo and Smaga (2023).
If values = TRUE
, a vector of values of the pointwise SSA test statistic.
Martinez-Camblor P., Corral N. (2011) Repeated Measures Analysis for Functional Data. Computational Statistics & Data Analysis 55, 3244–3256.
Kurylo K., Smaga L. (2023) Functional repeated measures analysis of variance and its application. Preprint https://arxiv.org/abs/2306.03883
# preparation of the DTI data set, for details see Kurylo and Smaga (2023) library(refund) data(DTI) # MS patients DTI_ms <- DTI[DTI$case == 1, ] miss_data <- c() for (i in 1:340) if (any(is.na(DTI_ms$cca[i, ]))) miss_data <- c(miss_data, i) DTI_ms <- DTI_ms[-miss_data, ] DTI_ms_2 <- DTI_ms[DTI_ms$Nscans == 4, ] xx <- vector("list", 4) for (i in 1:4) { xx[[i]] <- DTI_ms_2$cca[DTI_ms_2$visit == i, ] } xx[[1]] <- xx[[1]][-14, ] xx[[3]] <- xx[[3]][-14, ] yy <- xx for (i in seq_len(4)) yy[[i]] <- yy[[i]][1:17, ] # pointwise SSA test statistic pointwise_ssa_test_statistic(yy, xlab = "t", xaxt = "n") axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93))
# preparation of the DTI data set, for details see Kurylo and Smaga (2023) library(refund) data(DTI) # MS patients DTI_ms <- DTI[DTI$case == 1, ] miss_data <- c() for (i in 1:340) if (any(is.na(DTI_ms$cca[i, ]))) miss_data <- c(miss_data, i) DTI_ms <- DTI_ms[-miss_data, ] DTI_ms_2 <- DTI_ms[DTI_ms$Nscans == 4, ] xx <- vector("list", 4) for (i in 1:4) { xx[[i]] <- DTI_ms_2$cca[DTI_ms_2$visit == i, ] } xx[[1]] <- xx[[1]][-14, ] xx[[3]] <- xx[[3]][-14, ] yy <- xx for (i in seq_len(4)) yy[[i]] <- yy[[i]][1:17, ] # pointwise SSA test statistic pointwise_ssa_test_statistic(yy, xlab = "t", xaxt = "n") axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93))
The function rmfanova()
calculates the tests based on three test statistics
,
, and
for the problem of
comparing
-samples of repeated measures for functional data. The tests are based on
five resampling methods, i.e., two permutation and three bootstrap ones. The overall and local
hypotheses are considered.
rmfanova( x, method = "bonferroni", n_perm = 1000, n_boot = 1000, parallel = FALSE, n_cores = NULL, multi_gen = FALSE )
rmfanova( x, method = "bonferroni", n_perm = 1000, n_boot = 1000, parallel = FALSE, n_cores = NULL, multi_gen = FALSE )
x |
a list of length |
method |
the correction method to be used for pairwise comparisons. Options are |
n_perm |
a number of permutation replicates. The default is 1000. |
n_boot |
a number of bootstrap replicates. The default is 1000. |
parallel |
a logical indicating of whether to use parallel computing. The default is |
n_cores |
if |
multi_gen |
a logical indicating of whether to use separate multiple generations of Gaussian processes
for the parametric bootstrap tests. The default is FALSE, which means that the processes will be
generated once in a big matrix. This method is much faster, but for larger |
The function rmfanova()
concerns the tests for the functional repeated measures analysis problem.
The details are presented in Kurylo and Smaga (2023), where in particular, some recommendations for using tests are given.
Here we present only some summary of the problem and its solutions implemented in the package.
We have subjects subjected to
(possibly) different conditions.
The results of the experiments are functional observations. Let the subjects be represented
by a functional sample consisting of independent stochastic processes
defined on the
interval
, which satisfy the following model proposed by Martinez-Camblor and Corral (2011):
where is a fixed mean function, and
is a random process with zero mean function.
In this notation,
corresponds to the first experimental condition,
to the second, and so on. Thus, in this model, we ignore the possible time periods between repetitions
of the experiment, but this does not mean that they do not exist. We are interested in testing the equality
of
mean functions corresponding to experimental conditions; namely, the global null hypothesis is as follows:
For the global null hypothesis , the tests given by Martinez-Camblor and Corral (2011)
used the pointwise sum of squares due to the hypothesis:
where
. In the package, it is calculated and drawn by the
pointwise_ssa_test_statistic()
function.
The other option is the following pointwise F-type test statistic proposed in Kurylo and Smaga (2023):
where
is the pointwise sum of squares due to residuals, and
is calculated and drawn by the
pointwise_f_test_statistic()
function.
To obtain global test statistics for , Martinez-Camblor and Corral (2011) proposed the
following test statistic:
On the other hand, Kurylo and Smaga (2023) proposed the following two test statistics:
To construct the tests, five resampling strategies are proposed by Kurylo and Smaga (2023). For details, we refer
to this paper. Here we just note the two permutation tests and three bootstrap tests are denoted by P1, P2, B1, B2,
and B3 in the output of the summary.rmfanova()
function.
When , by rejecting the global null hypothesis
, we determine the presence of significant differences
in the mean functions corresponding to the experimental conditions. However, we do not know which conditions are
significantly different and which are not. To solve this problem, one needs to perform a post hoc analysis.
More precisely, we would like to test the family of hypotheses:
for ,
. These hypotheses are also named pairwise comparisons.
To test this family of local hypotheses, we propose the following procedure:
1. Test each of the hypotheses using the data for the
-th and
-th objects,
i.e.,
for
and
respectively, and the chosen test
from those presented above. Let
denote the
-values obtained.
2. Make a final decision using the Bonferroni method, i.e., reject if
, where
are the corrected
-values,
is the significance level and
is the number of null hypotheses considered.
In the paper Kurylo and Smaga (2023), the Bonferroni method was used only. However, in the package,
there is a possibility to use other correction methods, which are available in the vector p.adjust.methods
.
The results of testing the global and local hypotheses are given separately in the output of the
summary.rmfanova()
function for the convenience of the user.
A list of class rmfanova
containing the following 7 components:
n |
a number |
p |
a number |
l |
a number |
method |
an argument |
test_stat |
values of the test statistics |
p_values |
p-values for the global null hypothesis. |
p_values_pc |
p-values of the pairwise comparisons. |
Martinez-Camblor P., Corral N. (2011) Repeated Measures Analysis for Functional Data. Computational Statistics & Data Analysis 55, 3244–3256.
Kurylo K., Smaga L. (2023) Functional repeated measures analysis of variance and its application. Preprint https://arxiv.org/abs/2306.03883
Ramsay J.O., Silverman B.W. (2005) Functional Data Analysis, 2nd Edition. New York: Springer.
Zhang J.T. (2013) Analysis of Variance for Functional Data. London: Chapman & Hall.
# Some of the examples may run some time. # preparation of the DTI data set, for details see Kurylo and Smaga (2023) library(refund) data(DTI) # MS patients DTI_ms <- DTI[DTI$case == 1, ] miss_data <- c() for (i in 1:340) if (any(is.na(DTI_ms$cca[i, ]))) miss_data <- c(miss_data, i) DTI_ms <- DTI_ms[-miss_data, ] DTI_ms_2 <- DTI_ms[DTI_ms$Nscans == 4, ] xx <- vector("list", 4) for (i in 1:4) { xx[[i]] <- DTI_ms_2$cca[DTI_ms_2$visit == i, ] } xx[[1]] <- xx[[1]][-14, ] xx[[3]] <- xx[[3]][-14, ] yy <- xx for (i in seq_len(4)) yy[[i]] <- yy[[i]][1:17, ] # data trajectories for four visits oldpar <- par(mfrow = c(1, 4), mar = c(4, 4, 4, 0.1)) matplot(t(yy[[1]]), type = "l", col = 1, lty = 1, xlab = "t", ylab = "FA", main = "Visit 1", xaxt = "n", ylim = c(0.29, 0.73)) axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) matplot(t(yy[[2]]), type = "l", col = 1, lty = 1, xlab = "t", ylab = "FA", main = "Visit 2", xaxt = "n", ylim = c(0.29, 0.73)) axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) matplot(t(yy[[3]]), type = "l", col = 1, lty = 1, xlab = "t", ylab = "FA", main = "Visit 3", xaxt = "n", ylim = c(0.29, 0.73)) axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) matplot(t(yy[[4]]), type = "l", col = 1, lty = 1, xlab = "t", ylab = "FA", main = "Visit 4", xaxt = "n", ylim = c(0.29, 0.73)) axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) par(oldpar) # sample mean functions oldpar <- par(mfrow = c(1, 1), mar = c(4, 4, 2, 0.1)) pointwise_sample_mean_fun(yy, values = FALSE, col = 1:4, xlab = "t", ylab = "FA", xaxt = "n") axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) legend(x = 36, y = 0.64, legend = 1:4, lty = 1, col = 1:4, title = "Visit") par(oldpar) # pointwise SSA and F-type test statistics oldpar <- par(mfrow = c(1, 2), mar = c(4, 2, 2, 0.1)) pointwise_ssa_test_statistic(yy, xlab = "t", xaxt = "n") axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) pointwise_f_test_statistic(yy, xlab = "t", xaxt = "n") axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) par(oldpar) # testing without parallel computing and multiple generation of Gaussian processes res <- rmfanova(yy) summary(res, digits = 3) # testing without parallel computing and with multiple generation of Gaussian processes res <- rmfanova(yy, multi_gen = TRUE) summary(res, digits = 3) # testing with parallel computing and without multiple generation of Gaussian processes res <- rmfanova(yy, parallel = TRUE, n_cores = 2) summary(res, digits = 3) # testing with parallel computing and with multiple generation of Gaussian processes res <- rmfanova(yy, parallel = TRUE, multi_gen = TRUE, n_cores = 2) summary(res, digits = 3)
# Some of the examples may run some time. # preparation of the DTI data set, for details see Kurylo and Smaga (2023) library(refund) data(DTI) # MS patients DTI_ms <- DTI[DTI$case == 1, ] miss_data <- c() for (i in 1:340) if (any(is.na(DTI_ms$cca[i, ]))) miss_data <- c(miss_data, i) DTI_ms <- DTI_ms[-miss_data, ] DTI_ms_2 <- DTI_ms[DTI_ms$Nscans == 4, ] xx <- vector("list", 4) for (i in 1:4) { xx[[i]] <- DTI_ms_2$cca[DTI_ms_2$visit == i, ] } xx[[1]] <- xx[[1]][-14, ] xx[[3]] <- xx[[3]][-14, ] yy <- xx for (i in seq_len(4)) yy[[i]] <- yy[[i]][1:17, ] # data trajectories for four visits oldpar <- par(mfrow = c(1, 4), mar = c(4, 4, 4, 0.1)) matplot(t(yy[[1]]), type = "l", col = 1, lty = 1, xlab = "t", ylab = "FA", main = "Visit 1", xaxt = "n", ylim = c(0.29, 0.73)) axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) matplot(t(yy[[2]]), type = "l", col = 1, lty = 1, xlab = "t", ylab = "FA", main = "Visit 2", xaxt = "n", ylim = c(0.29, 0.73)) axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) matplot(t(yy[[3]]), type = "l", col = 1, lty = 1, xlab = "t", ylab = "FA", main = "Visit 3", xaxt = "n", ylim = c(0.29, 0.73)) axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) matplot(t(yy[[4]]), type = "l", col = 1, lty = 1, xlab = "t", ylab = "FA", main = "Visit 4", xaxt = "n", ylim = c(0.29, 0.73)) axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) par(oldpar) # sample mean functions oldpar <- par(mfrow = c(1, 1), mar = c(4, 4, 2, 0.1)) pointwise_sample_mean_fun(yy, values = FALSE, col = 1:4, xlab = "t", ylab = "FA", xaxt = "n") axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) legend(x = 36, y = 0.64, legend = 1:4, lty = 1, col = 1:4, title = "Visit") par(oldpar) # pointwise SSA and F-type test statistics oldpar <- par(mfrow = c(1, 2), mar = c(4, 2, 2, 0.1)) pointwise_ssa_test_statistic(yy, xlab = "t", xaxt = "n") axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) pointwise_f_test_statistic(yy, xlab = "t", xaxt = "n") axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93)) par(oldpar) # testing without parallel computing and multiple generation of Gaussian processes res <- rmfanova(yy) summary(res, digits = 3) # testing without parallel computing and with multiple generation of Gaussian processes res <- rmfanova(yy, multi_gen = TRUE) summary(res, digits = 3) # testing with parallel computing and without multiple generation of Gaussian processes res <- rmfanova(yy, parallel = TRUE, n_cores = 2) summary(res, digits = 3) # testing with parallel computing and with multiple generation of Gaussian processes res <- rmfanova(yy, parallel = TRUE, multi_gen = TRUE, n_cores = 2) summary(res, digits = 3)
Prints the summary of the repeated measures functional analysis of variance.
## S3 method for class 'rmfanova' summary(object, ...)
## S3 method for class 'rmfanova' summary(object, ...)
object |
a "rmfanova" object. |
... |
integer indicating the number of decimal places to be used to present the numerical results.
It can be named |
The function prints out the information about the number of samples ,
number of observations
, number of design time points
,
adjustment method for pairwise comparison tests (if
), test statistics,
and p-values of tests performed by the
rmfanova()
function.
No return value, called for side effects.
# Some of the examples may run some time. # preparation of the DTI data set, for details see Kurylo and Smaga (2023) library(refund) data(DTI) # MS patients DTI_ms <- DTI[DTI$case == 1, ] miss_data <- c() for (i in 1:340) if (any(is.na(DTI_ms$cca[i, ]))) miss_data <- c(miss_data, i) DTI_ms <- DTI_ms[-miss_data, ] DTI_ms_2 <- DTI_ms[DTI_ms$Nscans == 4, ] xx <- vector("list", 4) for (i in 1:4) { xx[[i]] <- DTI_ms_2$cca[DTI_ms_2$visit == i, ] } xx[[1]] <- xx[[1]][-14, ] xx[[3]] <- xx[[3]][-14, ] yy <- xx for (i in seq_len(4)) yy[[i]] <- yy[[i]][1:17, ] # testing without parallel computing and multiple generation of Gaussian processes res <- rmfanova(yy) summary(res, digits = 3)
# Some of the examples may run some time. # preparation of the DTI data set, for details see Kurylo and Smaga (2023) library(refund) data(DTI) # MS patients DTI_ms <- DTI[DTI$case == 1, ] miss_data <- c() for (i in 1:340) if (any(is.na(DTI_ms$cca[i, ]))) miss_data <- c(miss_data, i) DTI_ms <- DTI_ms[-miss_data, ] DTI_ms_2 <- DTI_ms[DTI_ms$Nscans == 4, ] xx <- vector("list", 4) for (i in 1:4) { xx[[i]] <- DTI_ms_2$cca[DTI_ms_2$visit == i, ] } xx[[1]] <- xx[[1]][-14, ] xx[[3]] <- xx[[3]][-14, ] yy <- xx for (i in seq_len(4)) yy[[i]] <- yy[[i]][1:17, ] # testing without parallel computing and multiple generation of Gaussian processes res <- rmfanova(yy) summary(res, digits = 3)