pointwise_f_test_statistic: Pointwise F-type test statistic

View source: R/rmfanova.R

pointwise_f_test_statisticR Documentation

Pointwise F-type test statistic

Description

The function pointwise_f_test_statistic() calculates and draws the pointwise F-type test statistic.

Usage

pointwise_f_test_statistic(
  x,
  plot = TRUE,
  values = FALSE,
  type = "l",
  ylab = "",
  main = "F(t)",
  ...
)

Arguments

x

a list of length \ell with elements being n\times p matrices of data corresponding to n functional observations measured in p design time points under given experimental conditions.

plot

a logical indicating of whether to draw the values of the pointwise F-type test statistic. The default is TRUE.

values

a logical indicating of whether to return the values of the pointwise F-type test statistic. The default is FALSE.

type

1-character string giving the type of plot desired, the same as in the plot() function. The default is "l" for lines.

ylab

a label for the y-axis, the same as in the plot() function. The default is the empty sign.

main

a main title for the plot, the same as in the plot() function. The default is F(t).

...

other graphical parameters, the same as in the plot() function.

Details

For details, see the documentation of the rmfanova() function or the paper Kurylo and Smaga (2023).

Value

If values = TRUE, a vector of values of the pointwise F-type test statistic.

References

Kurylo K., Smaga L. (2023) Functional repeated measures analysis of variance and its application. Preprint https://arxiv.org/abs/2306.03883

Examples

# preparation of the DTI data set, for details see Kurylo and Smaga (2023)
library(refund)
data(DTI)
# MS patients
DTI_ms <- DTI[DTI$case == 1, ]
miss_data <- c()
for (i in 1:340) if (any(is.na(DTI_ms$cca[i, ]))) miss_data <- c(miss_data, i)
DTI_ms <- DTI_ms[-miss_data, ]
DTI_ms_2 <- DTI_ms[DTI_ms$Nscans == 4, ]
xx <- vector("list", 4)
for (i in 1:4) {
  xx[[i]] <- DTI_ms_2$cca[DTI_ms_2$visit == i, ]
}
xx[[1]] <- xx[[1]][-14, ]
xx[[3]] <- xx[[3]][-14, ]
yy <- xx
for (i in seq_len(4)) yy[[i]] <- yy[[i]][1:17, ]
# pointwise F-type test statistic
pointwise_f_test_statistic(yy, xlab = "t", xaxt = "n")
axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93))


rmfanova documentation built on July 10, 2023, 2:03 a.m.