Globalaov: Global testing procedure for testing functional analysis of...

View source: R/Globalaov.R

GlobalaovR Documentation

Global testing procedure for testing functional analysis of variance

Description

The function implements the Global Testing procedure for testing mean differences between several functional populations in a one-way or multi-way functional analysis of variance framework. Functional data are tested globally and unadjusted and adjusted p-value functions are provided. The unadjusted p-value function controls the point-wise error rate. The adjusted p-value function controls the family-wise error rate weakly. Since this is a global test, the adjusted p-value function is constant.

Usage

Globalaov(
  formula,
  B = 1000,
  method = "residuals",
  dx = NULL,
  recycle = TRUE,
  stat = "Integral"
)

Arguments

formula

An object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. The output variable of the formula can be either a matrix of dimension c(n,J) collecting the pointwise evaluations of n functional data on the same grid of J points, or a fd object from the package fda.

B

The number of iterations of the MC algorithm to evaluate the p-values of the permutation tests. The defualt is B=1000.

method

Permutation method used to calculate the p-value of permutation tests. Choose "residuals" for the permutations of residuals under the reduced model, according to the Freedman and Lane scheme, and "responses" for the permutation of the responses, according to the Manly scheme.

dx

Used only if a fd object is provided. In this case, dx is the size of the discretization step of the grid used to evaluate functional data. If set to NULL, a grid of size 100 is used. Default is NULL.

stat

Type of test statistic used for the global test. Possible values are: 'Integral' (default) for the integral over the domain of the F-test statistic; 'Max' for max over the domain of the F-test statistic.

Value

Globalaov returns an object of class "IWTaov". The function summary is used to obtain and print a summary of the results. This object is a list containing the following components:

call

The matched call.

design_matrix

The design matrix of the functional-on-scalar linear model.

unadjusted_pval_F

Evaluation on a grid of the unadjusted p-value function of the functional F-test.

adjusted_pval_F

Evaluation on a grid of the adjusted p-value function of the functional F-test.

unadjusted_pval_factors

Evaluation on a grid of the unadjusted p-value function of the functional F-tests on each factor of the analysis of variance (rows).

adjusted.pval.factors

adjusted p-values of the functional F-tests on each factor of the analysis of variance (rows) and each basis coefficient (columns).

Global_pval_F

Global p-value of the overall test F.

Global_pval_factors

Global p-value of test F involving each factor separately.

data.eval

Evaluation on a fine uniform grid of the functional data obtained through the basis expansion.

coeff.regr.eval

Evaluation on a fine uniform grid of the functional regression coefficients.

fitted.eval

Evaluation on a fine uniform grid of the fitted values of the functional regression.

residuals.eval

Evaluation on a fine uniform grid of the residuals of the functional regression.

R2.eval

Evaluation on a fine uniform grid of the functional R-squared of the regression.

References

Abramowicz, K., Pini, A., Schelin, L., Stamm, A., & Vantini, S. (2022). “Domain selection and familywise error rate for functional data: A unified framework. Biometrics 79(2), 1119-1132.

D. Freedman and D. Lane (1983). A Nonstochastic Interpretation of Reported Significance Levels. Journal of Business & Economic Statistics 1.4, 292-298.

B. F. J. Manly (2006). Randomization, Bootstrap and Monte Carlo Methods in Biology. Vol. 70. CRC Press.

See Also

See summary.IWTaov for summaries and plot.IWTaov for plotting the results. See ITPaovbspline for a functional analysis of variance test based on B-spline basis expansion. See also IWTlm to fit and test a functional-on-scalar linear model applying the IWT, and IWT1, IWT2 for one-population and two-population tests.

Examples

# Importing the NASA temperatures data set
data(NASAtemp)
temperature <- rbind(NASAtemp$milan,NASAtemp$paris)
groups <- c(rep(0,22),rep(1,22))

# Performing the test
Global.result <- Globalaov(temperature ~ groups,B=1000)

# Summary of the test results
summary(Global.result)

# Plot of the results
layout(1)
plot(Global.result)

# All graphics on the same device
layout(matrix(1:4,nrow=2,byrow=FALSE))
plot(Global.result,main='NASA data', plot.adjpval = TRUE,xlab='Day',xrange=c(1,365))


alessiapini/fdatest documentation built on April 28, 2024, 12:35 a.m.