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.
ITPlmbspline(formula, order = 2,
nknots = dim(model.response(model.frame(formula)))[2],
B = 10000, method = "residuals")
An object of class "formula
" (or one that can be coerced to that class): a symbolic description of the model to be fitted.
Order of the B-spline basis expansion. The default is order=2
.
Number of knots of the B-spline basis expansion.
The default is dim(model.response(model.frame(formula)))[2]
.
The number of iterations of the MC algorithm to evaluate the p-values of the permutation tests. The defualt is B=10000
.
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.
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:
The matched call.
The design matrix of the functional-on-scalar linear model.
String vector indicating the basis used for the first phase of the algorithm. In this case equal to "B-spline"
.
Matrix of dimensions c(n,p)
of the p
coefficients of the B-spline basis expansion. Rows are associated to units and columns to the basis index.
Matrix of dimensions c(L+1,p)
of the p
coefficients of the B-spline basis expansion of the intercept (first row) and the L
effects of the covariates specified in formula
. Columns are associated to the basis index.
Uncorrected p-values of the functional F-test for each basis coefficient.
Matrix of dimensions c(p,p)
of the p-values of the multivariate F-tests. The element (i,j)
of matrix pval.matrix
contains the p-value of the joint NPC test of the components (j,j+1,...,j+(p-i))
.
Corrected p-values of the functional F-test for each basis coefficient.
Uncorrected p-values of the functional t-tests for each partial regression coefficient including the intercept (rows) and each basis coefficient (columns).
Array of dimensions c(L+1,p,p)
of the p-values of the multivariate t-tests. The element (l,i,j)
of array pval.matrix
contains the p-value of the joint NPC test on covariate l
of the components (j,j+1,...,j+(p-i))
.
Corrected p-values of the functional t-tests for each partial regression coefficient including the intercept (rows) and each basis coefficient (columns).
Evaluation on a fine uniform grid of the functional data obtained through the basis expansion.
Evaluation on a fine uniform grid of the functional regression coefficients.
Evaluation on a fine uniform grid of the fitted values of the functional regression.
Evaluation on a fine uniform grid of the residuals of the functional regression.
Evaluation on a fine uniform grid of the functional R-squared of the regression.
Heatmap matrix of p-values of functional F-test (used only for plots).
Heatmap matrix of p-values of functional t-tests (used only for plots).
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<U+00E4>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 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.
# NOT RUN {
# 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))
# }
Run the code above in your browser using DataLab