TWTlm | R Documentation |
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 Threshold-wise testing procedure (TWT) for testing the significance of the effects of scalar covariates on a functional population.
TWTlm(formula, B = 1000L, method = "residuals", dx = NULL)
formula |
An object of class " |
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 " |
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. |
An object of class TWTlm
. 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
: 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).
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-squared.
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 summary.TWTlm
for summaries and
plot.TWTlm
for plotting the results. See also
TWTaov
to fit and test a functional analysis of variance
applying the TWT, and TWT2
for two-population test.
# 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 TWT
TWT.result <- TWTlm(temperature ~ groups, B = 100L)
# Summary of the TWT results
summary(TWT.result)
# Plot of the TWT results
layout(1)
plot(
TWT.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(
TWT.result,
main = 'NASA data',
plot_adjpval = TRUE,
xlab = 'Day',
xrange = c(1, 365)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.