Type: | Package |
Title: | Interval Testing Procedure for Functional Data |
Version: | 2.1.1 |
Date: | 2022-05-04 |
Depends: | fda |
Author: | Alessia Pini, Simone Vantini |
Maintainer: | Alessia Pini <alessia.pini@polimi.it> |
Description: | Implementation of the Interval Testing Procedure for functional data in different frameworks (i.e., one or two-population frameworks, functional linear models) by means of different basis expansions (i.e., B-spline, Fourier, and phase-amplitude Fourier). The current version of the package requires functional data evaluated on a uniform grid; it automatically projects each function on a chosen functional basis; it performs the entire family of multivariate tests; and, finally, it provides the matrix of the p-values of the previous tests and the vector of the corrected p-values. The functional basis, the coupled or uncoupled scenario, and the kind of test can be chosen by the user. The package provides also a plotting function creating a graphical output of the procedure: the p-value heat-map, the plot of the corrected p-values, and the plot of the functional data. |
License: | GPL-2 |
Encoding: | UTF-8 |
NeedsCompilation: | no |
Packaged: | 2022-05-04 08:12:37 UTC; alessiapini |
Repository: | CRAN |
Date/Publication: | 2022-05-04 08:30:08 UTC |
Interval Testing Procedure for Functional Data
Description
Implementation of the Interval Testing Procedure for functional data in different frameworks (i.e., one or two-population frameworks, functional linear models) by means of different basis expansions (i.e., B-spline, Fourier, and phase-amplitude Fourier). The current version of the package requires functional data evaluated on a uniform grid; it automatically projects each function on a chosen functional basis; it performs the entire family of multivariate tests; and, finally, it provides the matrix of the p-values of the previous tests and the vector of the corrected p-values. The functional basis, the coupled or uncoupled scenario, and the kind of test can be chosen by the user. The package provides also a plotting function creating a graphical output of the procedure: the p-value heat-map, the plot of the corrected p-values, and the plot of the functional data.
Details
Package: | fdatest |
Type: | Package |
Version: | 2.1.1 |
Date: | 2022-05-04 |
License: | GPL-2 |
Author(s)
Alessia Pini, Simone Vantini
Maintainer: Alessia Pini <alessia.pini@polimi.it>
References
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
K. Abramowicz, S. De Luna, C. Häger, A. Pini, L. Schelin, and S. Vantini (2015). Distribution-Free Interval-Wise Inference for Functional-on-Scalar Linear Models. MOX-report 3/2015, Politecnico di Milano.
See Also
See also ITP1bspline
, ITP1fourier
, ITP2bspline
, ITP2fourier
, ITP2pafourier
, ITPlmbspline
, ITPaovbspline
, and ITPimage
.
Examples
# Importing the NASA temperatures data set
data(NASAtemp)
# Example 1:
# Performing the ITP for one population with the Fourier basis
ITP.result <- ITP1fourier(NASAtemp$milan,maxfrequency=10,B=1000)
# Plotting the results of the ITP
plot(ITP.result)
# Plotting the p-value heatmap
ITPimage(ITP.result)
# Selecting the significant coefficients
which(ITP.result$corrected.pval < 0.05)
# Example 2:
# Performing the ITP for two populations with the B-spline basis
ITP.result <- ITP2bspline(NASAtemp$milan,NASAtemp$paris,nknots=20,B=1000)
# Plotting the results of the ITP
plot(ITP.result)
# Plotting the p-values heatmap
ITPimage(ITP.result)
# Selecting the significant components for the radius at 5% level
which(ITP.result$corrected.pval < 0.05)
# Example 3:
# Fitting and testing a functional-on-scalar linear model
# Defining data and covariates
temperature <- rbind(NASAtemp$milan,NASAtemp$paris)
groups <- c(rep(0,22),rep(1,22))
# Performing the ITP
ITP.result <- ITPlmbspline(temperature ~ groups,B=1000,nknots=20,order=3)
# Summary of the ITP results
summary(ITP.result)
# Plot of the ITP results
layout(1)
plot(ITP.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(ITP.result,main='NASA data', plot.adjpval = TRUE,xlab='Day',xrange=c(1,365))
One population Interval Testing Procedure with B-spline basis
Description
The function implements the Interval Testing Procedure for testing the center of symmetry of a functional population evaluated on a uniform grid. Data are represented by means of the B-spline expansion and the significance of each basis coefficient is tested with an interval-wise control of the Family Wise Error Rate. The default parameters of the basis expansion lead to the piece-wise interpolating function.
Usage
ITP1bspline(data, mu = 0, order = 2, nknots = dim(data)[2], B = 10000)
Arguments
data |
Pointwise evaluations of the functional data set on a uniform grid. |
mu |
The center of symmetry under the null hypothesis: either a constant (in this case, a constant function is used) or a |
order |
Order of the B-spline basis expansion. The default is |
nknots |
Number of knots of the B-spline basis expansion. The default is |
B |
The number of iterations of the MC algorithm to evaluate the p-values of the permutation tests. The defualt is |
Value
ITP1bspline
returns an object of class
"ITP1
".
An object of class "ITP1
" is a list containing at least the following components:
basis |
String vector indicating the basis used for the first phase of the algorithm. In this case equal to |
test |
String vector indicating the type of test performed. In this case equal to |
mu |
Center of symmetry under the null hypothesis (as entered by the user). |
coeff |
Matrix of dimensions |
pval |
Uncorrected p-values for each basis coefficient. |
pval.matrix |
Matrix of dimensions |
corrected.pval |
Corrected p-values for each basis coefficient. |
labels |
Labels indicating the population membership of each data (in this case always equal to |
data.eval |
Evaluation on a fine uniform grid of the functional data obtained through the basis expansion. |
heatmap.matrix |
Heatmap matrix of p-values (used only for plots). |
Author(s)
Alessia Pini, Simone Vantini
References
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
See Also
See also ITP1fourier
, ITP2bspline
, ITP2fourier
, ITP2pafourier
, and ITPimage
.
Examples
# Importing the NASA temperatures data set
data(NASAtemp)
# Performing the ITP for two populations with the B-spline basis
ITP.result <- ITP1bspline(NASAtemp$paris,mu=4,nknots=50,B=1000)
# Plotting the results of the ITP
plot(ITP.result,xrange=c(0,12),main='Paris temperatures')
# Plotting the p-value heatmap
ITPimage(ITP.result,abscissa.range=c(0,12))
# Selecting the significant components for the radius at 5% level
which(ITP.result$corrected.pval < 0.05)
One population Interval Testing Procedure with Fourier basis
Description
The function implements the Interval Testing Procedure for testing the center of symmetry of a functional population evaluated on a uniform grid. Data are represented by means of the Fourier expansion and the significance of each basis coefficient is tested with an interval-wise control of the Family Wise Error Rate.
Usage
ITP1fourier(data, mu = 0, maxfrequency=floor(dim(data)[2]/2), B = 10000)
Arguments
data |
Pointwise evaluations of the functional data set on a uniform grid. |
mu |
The center of symmetry under the null hypothesis: either a constant (in this case, a constant function is used) or a |
maxfrequency |
The maximum frequency to be used in the Fourier basis expansion of data. The default is |
B |
The number of iterations of the MC algorithm to evaluate the p-values of the permutation tests. The defualt is |
Value
ITP1fourier
returns an object of class
"ITP1
".
An object of class "ITP1
" is a list containing at least the following components:
basis |
String vector indicating the basis used for the first phase of the algorithm. In this case equal to |
test |
String vector indicating the type of test performed. In this case equal to |
mu |
Center of symmetry under the null hypothesis (as entered by the user). |
coeff |
Matrix of dimensions |
pval |
Uncorrected p-values for each frequency. |
pval.matrix |
Matrix of dimensions |
corrected.pval |
Corrected p-values for each frequency. |
labels |
Labels indicating the population membership of each data (in this case always equal to |
data.eval |
Evaluation on a fine uniform grid of the functional data obtained through the basis expansion. |
heatmap.matrix |
Heatmap matrix of p-values (used only for plots). |
Author(s)
Alessia Pini, Simone Vantini
References
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
See Also
See also ITP1bspline
, ITP2bspline
, ITP2fourier
, ITP2pafourier
, and ITPimage
.
Examples
# Importing the NASA temperatures data set
data(NASAtemp)
# Performing the ITP
ITP.result <- ITP1fourier(NASAtemp$milan,maxfrequency=20,B=1000)
# Plotting the results of the ITP
plot(ITP.result,main='NASA data',xrange=c(1,365),xlab='Day')
# Plotting the p-value heatmap
ITPimage(ITP.result,abscissa.range=c(1,365))
# Selecting the significant coefficients
which(ITP.result$corrected.pval < 0.05)
Two populations Interval Testing Procedure with B-spline basis
Description
The function implements the Interval Testing Procedure for testing the difference between two functional populations evaluated on a uniform grid. Data are represented by means of the B-spline basis and the significance of each basis coefficient is tested with an interval-wise control of the Family Wise Error Rate. The default parameters of the basis expansion lead to the piece-wise interpolating function.
Usage
ITP2bspline(data1, data2, mu = 0,
order = 2, nknots = dim(data1)[2], B = 10000, paired = FALSE)
Arguments
data1 |
Pointwise evaluations of the first population's functional data set on a uniform grid. |
data2 |
Pointwise evaluations of the second population's functional data set on a uniform grid. |
mu |
The difference between the first functional population and the second functional population under the null hypothesis. Either a constant (in this case, a constant function is used) or a |
order |
Order of the B-spline basis expansion. The default is |
nknots |
Number of knots of the B-spline basis expansion. The default is |
B |
The number of iterations of the MC algorithm to evaluate the p-values of the permutation tests. The defualt is |
paired |
A logical indicating whether the test is paired. The default is |
Value
ITP2bspline
returns an object of class
"ITP2
".
An object of class "ITP2
" is a list containing at least the following components:
basis |
String vector indicating the basis used for the first phase of the algorithm. In this case equal to |
test |
String vector indicating the type of test performed. In this case equal to |
mu |
Difference between the first functional population and the second functional population under the null hypothesis (as entered by the user). |
paired |
Logical indicating whether the test is paired (as entered by the user). |
coeff |
Matrix of dimensions |
pval |
Uncorrected p-values for each basis coefficient. |
pval.matrix |
Matrix of dimensions |
corrected.pval |
Corrected p-values for each basis coefficient. |
labels |
Labels indicating the population membership of each data. |
data.eval |
Evaluation on a fine uniform grid of the functional data obtained through the basis expansion. |
heatmap.matrix |
Heatmap matrix of p-values (used only for plots). |
Author(s)
Alessia Pini, Simone Vantini
References
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
See Also
For tests of comparison between two populations, see ITP2fourier
, ITP2pafourier
.
For different types of ITP-based tests, see ITP1bspline
, ITP1fourier
, ITPlmbspline
, ITPaovbspline
and ITPimage
.
Examples
# Importing the NASA temperatures data set
data(NASAtemp)
# Performing the ITP
ITP.result <- ITP2bspline(NASAtemp$milan,NASAtemp$paris,nknots=50,B=1000)
# Plotting the results of the ITP
plot(ITP.result,main='NASA data',xrange=c(1,365),xlab='Day')
# Plotting the p-values heatmap
ITPimage(ITP.result,abscissa.range=c(0,12))
# Selecting the significant components at 5% level
which(ITP.result$corrected.pval < 0.05)
Two populations Interval Testing Procedure with Fourier basis
Description
The function implements the Interval Testing Procedure for testing the difference between two functional populations evaluated on a uniform grid. Data are represented by means of the Fourier basis and the significance of each basis coefficient is tested with an interval-wise control of the Family Wise Error Rate.
Usage
ITP2fourier(data1, data2, mu = 0,
maxfrequency=floor(dim(data1)[2]/2), B = 10000, paired = FALSE)
Arguments
data1 |
Pointwise evaluations of the first population's functional data set on a uniform grid. |
data2 |
Pointwise evaluations of the second population's functional data set on a uniform grid. |
mu |
The difference between the first functional population and the second functional population under the null hypothesis. Either a constant (in this case, a constant function is used) or a |
maxfrequency |
The maximum frequency to be used in the Fourier basis expansion of data. The default is |
B |
The number of iterations of the MC algorithm to evaluate the p-values of the permutation tests. The defualt is |
paired |
A logical indicating whether the test is paired. The default is |
Value
ITP2fourier
returns an object of class
"ITP2
".
An object of class "ITP2
" is a list containing at least the following components:
basis |
String vector indicating the basis used for the first phase of the algorithm. In this case equal to |
test |
String vector indicating the type of test performed. in this case equal to |
mu |
Difference between the first functional population and the second functional population under the null hypothesis (as entered by the user). |
paired |
Logical indicating whether the test is paired (as entered by the user). |
coeff |
Matrix of dimensions |
pval |
Uncorrected p-values for each frequency. |
pval.matrix |
Matrix of dimensions |
corrected.pval |
Corrected p-values for each frequency. |
labels |
Labels indicating the population membership of each data. |
data.eval |
Evaluation on a fine uniform grid of the functional data obtained through the basis expansion. |
heatmap.matrix |
Heatmap matrix of p-values (used only for plots). |
Author(s)
Alessia Pini, Simone Vantini
References
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
See Also
See also ITP2pafourier
, ITP2bspline
, ITP1fourier
, ITP1bspline
, and ITPimage
.
Examples
# Importing the NASA temperatures data set
data(NASAtemp)
# Performing the ITP
ITP.result <- ITP2fourier(NASAtemp$milan,NASAtemp$paris,maxfrequency=20,B=1000,paired=TRUE)
# Plotting the results of the ITP
plot(ITP.result,main='NASA data',xrange=c(1,365),xlab='Day')
# Plotting the p-value heatmap
ITPimage(ITP.result,abscissa.range=c(1,365))
# Selecting the significant coefficients
which(ITP.result$corrected.pval < 0.05)
Two populations Interval Testing Procedure with Fourier basis (phase-amplitude decomposition)
Description
The function implements the Interval Testing Procedure for testing the difference between two functional populations evaluated on a uniform grid. Data are represented by means of the Fourier basis expansion with the phase-amplitude decomposition and the significance of the amplitude and phase of each frequency is tested with an interval-wise control of the Family Wise Error Rate.
Usage
ITP2pafourier(data1, data2,
maxfrequency=floor(dim(data1)[2]/2), B = 10000, paired = FALSE)
Arguments
data1 |
Pointwise evaluations of the first population's functional data set on a uniform grid. |
data2 |
Pointwise evaluations of the second population's functional data set on a uniform grid. |
maxfrequency |
The maximum frequency to be used in the Fourier basis expansion of data. The default is |
B |
The number of iterations of the MC algorithm to evaluate the p-values of the permutation tests. The defualt is |
paired |
A logical indicating whether the test is paired. The default is |
Value
ITP2pafourier
returns an object of class
"ITP2
".
An object of class "ITP2
" is a list containing at least the following components:
basis |
String vector indicating the basis used for the first phase of the algorithm. Equal to |
test |
String vector indicating the type of test performed. Equal to |
paired |
Logical indicating whether the test is paired (as entered by the user). |
coeff_phase |
Matrix of dimensions |
coeff_amplitude |
Matrix of dimensions |
pval_phase |
Uncorrected p-values of the phase tests for each frequency. |
pval_amplitude |
Uncorrected p-values of the amplitude tests for each frequency. |
pval.matrix_phase |
Matrix of dimensions |
pval.matrix_amplitude |
Matrix of dimensions |
corrected.pval_phase |
Corrected p-values of the phase tests for each frequency. |
corrected.pval_amplitude |
Corrected p-values of the amplitude tests for each frequency. |
labels |
Labels indicating the population membership of each data. |
data.eval |
Evaluation on a fine uniform grid of the functional data obtained through the basis expansion. |
heatmap.matrix_phase |
Heatmap matrix of p-values for phase (used only for plots). |
heatmap.matrix_amplitude |
Heatmap matrix of p-values for amplitude (used only for plots). |
Author(s)
Alessia Pini, Simone Vantini
References
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
See Also
See also ITP2fourier
, ITP2bspline
, ITP1fourier
, ITP1bspline
, and ITPimage
.
Examples
# Importing the NASA temperatures data set
data(NASAtemp)
# Performing the ITP
ITP.result <- ITP2pafourier(NASAtemp$milan,NASAtemp$paris,maxfrequency=20,B=1000,paired=TRUE)
# Plotting the results of the ITP
plot(ITP.result,main='NASA data',xrange=c(1,365),xlab='Day')
# Plotting the p-value heatmap
ITPimage(ITP.result,abscissa.range=c(1,365))
# Selecting the significant coefficients
which(ITP.result$corrected.pval < 0.05)
Interval Testing Procedure for testing Functional analysis of variance with B-spline basis
Description
ITPaovbspline
is used to fit and test functional analysis of variance.
The function implements the Interval Testing Procedure for testing for significant differences between several functional population evaluated on a uniform grid. Data are represented by means of the B-spline basis and the significance of each basis coefficient is tested with an interval-wise control of the Family Wise Error Rate. The default parameters of the basis expansion lead to the piece-wise interpolating function.
Usage
ITPaovbspline(formula, order = 2,
nknots = dim(model.response(model.frame(formula)))[2],
B = 10000, method = "residuals")
Arguments
formula |
An object of class " |
order |
Order of the B-spline basis expansion. The default is |
nknots |
Number of knots of the B-spline basis expansion. The default is |
B |
The number of iterations of the MC algorithm to evaluate the p-values of the permutation tests. The defualt is |
method |
Permutation method used to calculate the p-value of permutation tests. Choose " |
Value
ITPaovbspline
returns an object of class
"ITPaov
".
The function summary
is used to obtain and print a summary of the results.
An object of class "ITPlm
" is a list containing at least the following components:
call |
The matched call. |
design.matrix |
The design matrix of the functional-on-scalar linear model. |
basis |
String vector indicating the basis used for the first phase of the algorithm. In this case equal to |
coeff |
Matrix of dimensions |
coeff.regr |
Matrix of dimensions |
pval.F |
Uncorrected p-values of the functional F-test for each basis coefficient. |
pval.matrix.F |
Matrix of dimensions |
corrected.pval.F |
Corrected p-values of the functional F-test for each basis coefficient. |
pval.factors |
Uncorrected p-values of the functional F-tests on each factor of the analysis of variance, separately (rows) and each basis coefficient (columns). |
pval.matrix.factors |
Array of dimensions |
corrected.pval.factors |
Corrected p-values of the functional F-tests on each factor of the analysis of variance (rows) and each basis coefficient (columns). |
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. |
heatmap.matrix.F |
Heatmap matrix of p-values of functional F-test (used only for plots). |
heatmap.matrix.factors |
Heatmap matrix of p-values of functional F-tests on each factor of the analysis of variance (used only for plots). |
Author(s)
Alessia Pini, Simone Vantini
References
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.
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
K. Abramowicz, S. De Luna, C. Häger, A. Pini, L. Schelin, and S. Vantini (2015). Distribution-Free Interval-Wise Inference for Functional-on-Scalar Linear Models. MOX-report 3/2015, Politecnico di Milano.
See Also
See summary.ITPaov
for summaries and plot.ITPaov
for plotting the results.
See also ITPlmbspline
to fit and test a functional-on-scalar linear model applying the ITP, and ITP1bspline
, ITP2bspline
, ITP2fourier
, ITP2pafourier
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 ITP
ITP.result <- ITPaovbspline(temperature ~ groups,B=1000,nknots=20,order=3)
# Summary of the ITP results
summary(ITP.result)
# Plot of the ITP results
layout(1)
plot(ITP.result)
# All graphics on the same device
layout(matrix(1:4,nrow=2,byrow=FALSE))
plot(ITP.result,main='NASA data', plot.adjpval = TRUE,xlab='Day',xrange=c(1,365))
Plot of the Interval Testing Procedure results
Description
Plotting function creating a graphical output of the ITP: the p-value heat-map, the plot of the corrected p-values, and the plot of the functional data.
Usage
ITPimage(ITP.result, alpha = 0.05, abscissa.range = c(0, 1), nlevel = 20)
Arguments
ITP.result |
Results of the ITP, as created by |
alpha |
Level of the hypothesis test. The default is |
abscissa.range |
Range of the plot abscissa. The default is |
nlevel |
Number of desired color levels for the p-value heatmap. The default is |
Value
No value returned.
The function produces a graphical output of the ITP results: the p-value heatmap, a plot of the corrected p-values and the plot of the functional data.
The basis components selected as significant by the test at level alpha
are highlighted in the plot of the corrected p-values by a gray area.
Author(s)
Alessia pini, Simone Vantini
References
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
See Also
See plot.ITP1
, plot.ITP2
, plot.ITPlm
, and plot.ITPaov
for the plot method applied to the ITP results of one- and two-population tests, linear models, and ANOVA, respectively.
See also ITP1bspline
, ITP1fourier
, ITP2bspline
, ITP2fourier
, and ITP2pafourier
for applying the ITP.
Examples
# Importing the NASA temperatures data set
data(NASAtemp)
# Performing the ITP for two populations with the B-spline basis
ITP.result <- ITP2bspline(NASAtemp$milan,NASAtemp$paris,nknots=20,B=1000)
# Plotting the results of the ITP
ITPimage(ITP.result,abscissa.range=c(0,12))
# Selecting the significant components for the radius at 5% level
which(ITP.result$corrected.pval < 0.05)
Interval Testing Procedure for testing Functional-on-Scalar Linear Models with B-spline basis
Description
ITPlmbspline
is used to fit and test functional linear models. It can be used to carry out regression, and analysis of variance.
The function implements the Interval Testing Procedure for testing the significance of the effects of scalar covariates on a functional population evaluated on a uniform grid. Data are represented by means of the B-spline basis and the significance of each basis coefficient is tested with an interval-wise control of the Family Wise Error Rate. The default parameters of the basis expansion lead to the piece-wise interpolating function.
Usage
ITPlmbspline(formula, order = 2,
nknots = dim(model.response(model.frame(formula)))[2],
B = 10000, method = "residuals")
Arguments
formula |
An object of class " |
order |
Order of the B-spline basis expansion. The default is |
nknots |
Number of knots of the B-spline basis expansion. The default is |
B |
The number of iterations of the MC algorithm to evaluate the p-values of the permutation tests. The defualt is |
method |
Permutation method used to calculate the p-value of permutation tests. Choose " |
Value
ITPlmbspline
returns an object of class
"ITPlm
".
The function summary
is used to obtain and print a summary of the results.
An object of class "ITPlm
" is a list containing at least the following components:
call |
The matched call. |
design.matrix |
The design matrix of the functional-on-scalar linear model. |
basis |
String vector indicating the basis used for the first phase of the algorithm. In this case equal to |
coeff |
Matrix of dimensions |
coeff.regr |
Matrix of dimensions |
pval.F |
Uncorrected p-values of the functional F-test for each basis coefficient. |
pval.matrix.F |
Matrix of dimensions |
corrected.pval.F |
Corrected p-values of the functional F-test for each basis coefficient. |
pval.t |
Uncorrected p-values of the functional t-tests for each partial regression coefficient including the intercept (rows) and each basis coefficient (columns). |
pval.matrix.t |
Array of dimensions |
corrected.pval.t |
Corrected p-values of the functional t-tests for each partial regression coefficient including the intercept (rows) and each basis coefficient (columns). |
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. |
heatmap.matrix.F |
Heatmap matrix of p-values of functional F-test (used only for plots). |
heatmap.matrix.t |
Heatmap matrix of p-values of functional t-tests (used only for plots). |
Author(s)
Alessia Pini, Simone Vantini
References
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.
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
K. Abramowicz, S. De Luna, C. Häger, A. Pini, L. Schelin, and S. Vantini (2015). Distribution-Free Interval-Wise Inference for Functional-on-Scalar Linear Models. MOX-report 3/2015, Politecnico di Milano.
See Also
See summary.ITPlm
for summaries and plot.ITPlm
for plotting the results.
See also ITPaovbspline
to fit and test a functional analysis of variance applying the ITP, and ITP1bspline
, ITP2bspline
, ITP2fourier
, ITP2pafourier
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 ITP
ITP.result <- ITPlmbspline(temperature ~ groups,B=1000,nknots=20)
# Summary of the ITP results
summary(ITP.result)
# Plot of the ITP results
layout(1)
plot(ITP.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(ITP.result,main='NASA data', plot.adjpval = TRUE,xlab='Day',xrange=c(1,365))
NASA daily temperatures data set
Description
It contains the daily mean temperatures registered from July 1983 to June 2005 and stored in the NASA database Earth Surface Meteorology for Solar Energy of two different geographical locations: the region (45-46 North, 9-10 East), including the city of Milan (Italy), and the region (48-49 North, 2-3 East), including the city of Paris (France).
Usage
data(NASAtemp)
Format
List of 2 elements:
milan
Matrix of dimensionsc(22,365)
containing the daily mean temperatures of the region (45-46 North, 9-10 East), including the city of Milan (Italy) registered from July 1983 to June 2005 (22 years).paris
Matrix of dimensionsc(22,365)
containing the daily mean temperatures of the region (48-49 North, 2-3 East), including the city of Paris (France) registered from July 1983 to June 2005 (22 years).
Source
These data were obtained from the NASA Langley Research Center Atmospheric Science Data Center Surface meteorological and Solar Energy (SSE) web portal supported by the NASA LaRC POWER Project. Data are freely available at: NASA Surface Meteorology and Solar Energy, A Renewable Energy Resource web site (release 6.0): http://eosweb.larc.nasa.gov
Examples
data(NASAtemp)
## Not run:
matplot(t(NASAtemp$milan),type='l')
matplot(t(NASAtemp$paris),type='l')
## End(Not run)
Plotting ITP results for one-population tests
Description
plot
method for class "ITP1
".
Plotting function creating a graphical output of the ITP for the test of the mean of one population: functional data and ITP-adjusted p-values are plotted.
Usage
## S3 method for class 'ITP1'
plot(x, xrange = c(0, 1), alpha1 = 0.05, alpha2 = 0.01,
ylab = "Functional Data", main = NULL, lwd = 1, col = 1,
pch = 16, ylim = range(object$data.eval), ...)
Arguments
x |
The object to be plotted.
An object of class " |
xrange |
Range of the |
alpha1 |
First level of significance used to select and display significant differences. Default is |
alpha2 |
Second level of significance used to select and display significant differences. Default is |
ylab |
Label of |
main |
An overall title for the plots (it will be pasted to " |
lwd |
Line width for the plot of functional data. |
col |
Color used to plot the functional data. |
pch |
Point character for the plot of adjusted p-values. |
ylim |
Range of the |
... |
Additional plotting arguments that can be used with function |
Value
No value returned.
The function produces a graphical output of the ITP results: the plot of the functional data and the one of the adjusted p-values.
The basis components selected as significant by the test at level alpha1
and alpha2
are highlighted in the plot of the corrected p-values and in the one of functional data (in case the test is based on a local basis, such as B-splines) by gray areas (light and dark gray, respectively).
Author(s)
Alessia Pini, Simone Vantini
References
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
See Also
ITPimage
for the plot of p-values heatmaps.
See also ITP1bspline
and ITP1fourier
to perform the ITP to test for the mean of a functional populations.
See plot.ITP2
and plot.ITPlm
for the plot method applied to the ITP results of two-population tests and linear models, respectively.
Examples
# Importing the NASA temperatures data set
data(NASAtemp)
# Performing the ITP for one population with the B-spline basis
ITP.result.bspline <- ITP1bspline(NASAtemp$paris,mu=4,nknots=50,B=1000)
# Plotting the results of the ITP
plot(ITP.result.bspline,xlab='Day',xrange=c(0,365),main='NASA data')
# Selecting the significant components for the radius at 5% level
which(ITP.result.bspline$corrected.pval < 0.05)
Plotting ITP results for two-population tests
Description
plot
method for class "ITP2
".
Plotting function creating a graphical output of the ITP for the test of comparison between two populations: functional data and ITP-adjusted p-values are plotted.
Usage
## S3 method for class 'ITP2'
plot(x, xrange = c(0, 1), alpha1 = 0.05, alpha2 = 0.01,
ylab = "Functional Data", main = NULL, lwd = 1,
col = c(1, 2), pch = 16, ylim = range(object$data.eval), ...)
Arguments
x |
The object to be plotted.
An object of class " |
xrange |
Range of the |
alpha1 |
First level of significance used to select and display significant differences. Default is |
alpha2 |
Second level of significance used to select and display significant differences. Default is |
ylab |
Label of |
main |
An overall title for the plots (it will be pasted to " |
lwd |
Line width for the plot of functional data. |
col |
Color used to plot the functional data. |
pch |
Point character for the plot of adjusted p-values. |
ylim |
Range of the |
... |
Additional plotting arguments that can be used with function |
Value
No value returned.
The function produces a graphical output of the ITP results: the plot of the functional data and the one of the adjusted p-values.
The basis components selected as significant by the test at level alpha1
and alpha2
are highlighted in the plot of the corrected p-values and in the one of functional data (in case the test is based on a local basis, such as B-splines) by gray areas (light and dark gray, respectively).
In the case of a Fourier basis with amplitude and phase decomposition, two plots of adjusted p-values are done, one for phase and one for amplitude.
Author(s)
Alessia Pini, Simone Vantini
References
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
See Also
ITPimage
for the plot of p-values heatmaps.
See also ITP2bspline
, ITP2fourier
, ITP2pafourier
to perform the ITP to test for differences between two populations.
See plot.ITP1
and plot.ITPlm
for the plot method applied to the ITP results of one-population tests and a linear models, respectively.
Examples
# Importing the NASA temperatures data set
data(NASAtemp)
# Performing the ITP for two populations with the B-spline basis
ITP.result.bspline <- ITP2bspline(NASAtemp$milan,NASAtemp$paris,nknots=30,B=1000)
# Plotting the results of the ITP
plot(ITP.result.bspline,xlab='Day',xrange=c(1,365),main='NASA data')
# Selecting the significant components for the radius at 5% level
which(ITP.result.bspline$corrected.pval < 0.05)
Plotting ITP results for functional analysis of variance testing
Description
plot
method for class "ITPaov
".
Plotting function creating a graphical output of the ITP for the test on a functional analysis of variance: functional data, and ITP-adjusted p-values of the F-tests on the whole model and on each factor are plotted.
Usage
## S3 method for class 'ITPaov'
plot(x,xrange=c(0,1), alpha1=0.05, alpha2=0.01,
plot.adjpval=FALSE,ylim=range(x$data.eval),col=1,
ylab='Functional Data',main=NULL,lwd=1,pch=16,...)
Arguments
x |
The object to be plotted.
An object of class " |
xrange |
Range of the |
alpha1 |
First level of significance used to select and display significant effects. Default is |
alpha2 |
Second level of significance used to select and display significant effects. Default is |
plot.adjpval |
A logical indicating wether the plots of adjusted p-values have to be done. Default is |
col |
Colors for the plot of functional data. Default is |
ylim |
Range of the |
ylab |
Label of |
main |
An overall title for the plots (it will be pasted to " |
lwd |
Line width for the plot of functional data. Default is |
pch |
Point character for the plot of adjusted p-values. Default is |
... |
Additional plotting arguments that can be used with function |
Value
No value returned.
The function produces a graphical output of the ITP results: the plot of the functional data, functional regression coefficients, and ITP-adjusted p-values of the F-tests on the whole model and on each factor.
The basis components selected as significant by the tests at level alpha1
and alpha2
are highlighted in the plot of the corrected p-values and in the one of functional data by gray areas (light and dark gray, respectively).
The first plot reports the gray areas corresponding to a significant F-test on the whole model. The remaining plots report the gray areas corresponding to significant F-tests on each factor (with colors corresponding to the levels of the factor).
Author(s)
Alessia Pini, Simone Vantini
References
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
K. Abramowicz, S. De Luna, C. Häger, A. Pini, L. Schelin, and S. Vantini (2015). Distribution-Free Interval-Wise Inference for Functional-on-Scalar Linear Models. MOX-report 3/2015, Politecnico di Milano.
See Also
See also ITPaovbspline
to fit and test a functional analysis of variance applying the ITP, and summary.ITPaov
for summaries.
See plot.ITPlm
, plot.ITP1
, and plot.ITP2
for the plot method applied to the ITP results of functional-on-scalar linear models, one-population and two-population, respectively.
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 ITP
ITP.result <- ITPaovbspline(temperature ~ groups,B=1000,nknots=20,order=3)
# Summary of the ITP results
summary(ITP.result)
# Plot of the ITP results
layout(1)
plot(ITP.result)
# All graphics on the same device
layout(matrix(1:4,nrow=2,byrow=FALSE))
plot(ITP.result,main='NASA data', plot.adjpval = TRUE,xlab='Day',xrange=c(1,365))
Plotting ITP results for functional-on-scalar linear model testing
Description
plot
method for class "ITPlm
".
Plotting function creating a graphical output of the ITP for the test on a functional-on-scalar linear model: functional data, functional coefficients and ITP-adjusted p-values for the F-test and t-tests are plotted.
Usage
## S3 method for class 'ITPlm'
plot(x, xrange = c(0, 1), alpha1 = 0.05, alpha2 = 0.01,
plot.adjpval = FALSE, col = c(1, rainbow(dim(x$corrected.pval.t)[1])),
ylim = range(x$data.eval), ylab = "Functional Data",
main = NULL, lwd = 1, pch = 16, ...)
Arguments
x |
The object to be plotted.
An object of class " |
xrange |
Range of the |
alpha1 |
First level of significance used to select and display significant effects. Default is |
alpha2 |
Second level of significance used to select and display significant effects. Default is |
plot.adjpval |
A logical indicating wether the plots of adjusted p-values have to be done. Default is |
col |
Vector of colors for the plot of functional data (first element), and functional coefficients (following elements). Default is |
ylim |
Range of the |
ylab |
Label of |
main |
An overall title for the plots (it will be pasted to " |
lwd |
Line width for the plot of functional data. Default is |
pch |
Point character for the plot of adjusted p-values. Default is |
... |
Additional plotting arguments that can be used with function |
Value
No value returned.
The function produces a graphical output of the ITP results: the plot of the functional data, functional regression coefficients, and ITP-adjusted p-values for the F-test and t-tests.
The basis components selected as significant by the tests at level alpha1
and alpha2
are highlighted in the plot of the corrected p-values and in the one of functional data by gray areas (light and dark gray, respectively).
The plot of functional data reports the gray areas corresponding to a significant F-test. The plots of functional regression coefficients report the gray areas corresponding to significant t-tests for the corresponding covariate.
Author(s)
Alessia Pini, Simone Vantini
References
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
K. Abramowicz, S. De Luna, C. Häger, A. Pini, L. Schelin, and S. Vantini (2015). Distribution-Free Interval-Wise Inference for Functional-on-Scalar Linear Models. MOX-report 3/2015, Politecnico di Milano.
See Also
See also ITPlmbspline
to fit and test a functional-on-scalar linear model applying the ITP, and summary.ITPlm
for summaries.
See plot.ITPaov
, plot.ITP1
, and plot.ITP2
for the plot method applied to the ITP results of functional analysis of variance, one-population and two-population, respectively.
Examples
# Importing the NASA temperatures data set
data(NASAtemp)
data <- rbind(NASAtemp$milan,NASAtemp$paris)
lab <- c(rep(0,22),rep(1,22))
# Performing the ITP
ITP.result <- ITPlmbspline(data ~ lab,B=1000,nknots=20,order=3)
# Summary of the ITP results
summary(ITP.result)
# Plot of the ITP results
layout(1)
plot(ITP.result,main='NASA data',xlab='Day',xrange=c(1,365))
# Plots of the adjusted p-values
plot(ITP.result,main='NASA data', plot.adjpval = TRUE,xlab='Day',xrange=c(1,365))
# To have all plots in one device
layout(matrix(1:6,nrow=3,byrow=FALSE))
plot(ITP.result,main='NASA data', plot.adjpval = TRUE,xlab='Day',xrange=c(1,365))
Summarizing Functional Analysis of Variance Fits
Description
summary
method for class "ITPaov
".
Usage
## S3 method for class 'ITPaov'
summary(object, ...)
Arguments
object |
An object of class " |
... |
Further arguments passed to or from other methods. |
Value
The function summary.ITPaov
computes and returns a list of summary statistics of the fitted functional analysis of variance given in object
, using the component "call
" from its arguments, plus:
factors |
A |
R2 |
Range of the functional R-squared. |
ftest |
ITP-adjusted minimum p-value of functional F-test. |
Author(s)
Alessia Pini, Simone Vantini
References
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
K. Abramowicz, S. De Luna, C. Häger, A. Pini, L. Schelin, and S. Vantini (2015). Distribution-Free Interval-Wise Inference for Functional-on-Scalar Linear Models. MOX-report 3/2015, Politecnico di Milano.
See Also
See ITPaovbspline
for fitting and testing the functional ANOVA and plot.ITPaov
for plots.
See also ITPlmbspline
, ITP1bspline
, ITP2bspline
, ITP2fourier
, ITP2pafourier
.
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 ITP
ITP.result <- ITPaovbspline(temperature ~ groups,B=1000,nknots=20,order=3)
# Summary of the ITP results
summary(ITP.result)
Summarizing Functional-on-Scalar Linear Model Fits
Description
summary
method for class "ITPlm
".
Usage
## S3 method for class 'ITPlm'
summary(object, ...)
Arguments
object |
An object of class " |
... |
Further arguments passed to or from other methods. |
Value
The function summary.ITPlm
computes and returns a list of summary statistics of the fitted functional-on-scalar linear model given in object
, using the component "call
" from its arguments, plus:
ttest |
A |
R2 |
Range of the functional R-squared. |
ftest |
ITP-adjusted minimum p-value of functional F-test. |
Author(s)
Alessia Pini, Simone Vantini
References
A. Pini and S. Vantini (2013). The Interval Testing Procedure: Inference for Functional Data Controlling the Family Wise Error Rate on Intervals. MOX-report 13/2013, Politecnico di Milano.
K. Abramowicz, S. De Luna, C. Häger, A. Pini, L. Schelin, and S. Vantini (2015). Distribution-Free Interval-Wise Inference for Functional-on-Scalar Linear Models. MOX-report 3/2015, Politecnico di Milano.
See Also
See ITPlmbspline
for fitting and testing the functional linear model and plot.ITPlm
for plots.
See also ITPaovbspline
, ITP1bspline
, ITP2bspline
, ITP2fourier
, ITP2pafourier
.
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 ITP
ITP.result <- ITPlmbspline(temperature ~ groups, B=1000,nknots=20)
# Summary of the ITP results
summary(ITP.result)