Globallm: Global testing procedure for testing functional-on-scalar...

View source: R/Globallm.R

GloballmR Documentation

Global testing procedure for testing functional-on-scalar linear models

Description

The function is used to fit and test functional linear models. It can be used to carry out regression, and analysis of variance. It implements the global testing procedure for testing the significance of the effects of scalar covariates on a functional population.

Usage

Globallm(
  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. Example: y ~ A + B where: y is a matrix of dimension n * p containing the point-wise evaluations of the n functional data on p points or an object of class fd (see fda package) containing the functional data set A, B are n-dimensional vectors containing the values of two covariates. Covariates may be either scalar or factors.

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

step size for the point-wise evaluations of functional data. dx is only used ia an object of class 'fd' is provided as response in the formula.

stat

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

Value

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

call

call of the function.

design_matrix

design matrix of the linear model.

unadjusted_pval_F

unadjusted p-value function of the F test.

adjusted_pval_F

adjusted p-value function of the F test.

unadjusted_pval_part

unadjusted p-value functions of the functional t-tests on each covariate, separately (rows) on each domain point (columns).

adjusted_pval_part

adjusted p-values of the functional t-tests on each covariate (rows) on each domain point (columns).

Global_pval_F

Global p-value of the overall test F.

Global_pval_part

Global p-value of t-test involving each covariate separately.

data.eval

evaluation of functional data.

coeff.regr.eval

evaluation of the regression coefficients.

fitted.eval

evaluation of the fitted values.

residuals.eval

evaluation of the residuals.

R2.eval

evaluation of the functional R-suared.

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.IWTlm for summaries and plot.IWTlm for plotting the results. See ITPlmbspline for a functional linear model test based on an a-priori selected B-spline basis expansion. See also IWTaov to fit and test a functional analysis of variance applying the IWT, and IWT1, IWT2 for one-population and two-population tests.

Examples

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

# Performing the IWT
Global.result <- Globallm(temperature ~ groups,B=1000)
# Summary of the IWT results
summary(Global.result)

# Plot of the IWT results
layout(1)
plot(Global.result,main='NASA data', plot_adjpval = TRUE,xlab='Day',xrange=c(1,365))

# All graphics on the same device
layout(matrix(1:6,nrow=3,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.