pointwise_sample_mean_fun | R Documentation |
The function pointwise_sample_mean_fun()
calculates and draws the pointwise sample mean functions.
pointwise_sample_mean_fun(
x,
plot = TRUE,
values = FALSE,
type = "l",
lty = 1,
main = "Sample mean functions",
...
)
x |
a list of length |
plot |
a logical indicating of whether to draw the values of the pointwise sample mean functions.
The default is |
values |
a logical indicating of whether to return the values of the pointwise sample mean functions.
The default is |
type |
1-character string giving the type of plot desired, the same as in the |
lty |
vector of line types, the same as in the |
main |
a main title for the plot, the same as in the |
... |
other graphical parameters, the same as in the |
If values = TRUE
, a matrix of values of the pointwise sample mean functions.
Kurylo K., Smaga L. (2023) Functional repeated measures analysis of variance and its application. Preprint https://arxiv.org/abs/2306.03883
# 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, ]
# sample mean functions
oldpar <- par(mfrow = c(1, 1), mar = c(4, 4, 2, 0.1))
pointwise_sample_mean_fun(yy, values = FALSE,
col = 1:4, xlab = "t", ylab = "FA", xaxt = "n")
axis(1, c(1, 15, 30, 45, 60, 75, 93), labels = c(1, 15, 30, 45, 60, 75, 93))
legend(x = 36, y = 0.64, legend = 1:4, lty = 1, col = 1:4, title = "Visit")
par(oldpar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.