pointwise_ssa_test_statistic {rmfanova}R Documentation

Pointwise SSA test statistic

Description

The function pointwise_ssa_test_statistic() calculates and draws the pointwise SSA test statistic.

Usage

pointwise_ssa_test_statistic(
  x,
  plot = TRUE,
  values = FALSE,
  type = "l",
  ylab = "",
  main = "SSA(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 SSA test statistic. The default is TRUE.

values

a logical indicating of whether to return the values of the pointwise SSA 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 SSA(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 SSA test statistic.

References

Martinez-Camblor P., Corral N. (2011) Repeated Measures Analysis for Functional Data. Computational Statistics & Data Analysis 55, 3244–3256.

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 SSA test statistic
pointwise_ssa_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))


[Package rmfanova version 0.1.0 Index]