Summarize the requested phenotype variables by timepoint. Numeric phenotypes are reported with mean, standard deviation, and non-missing counts; non-numeric phenotypes are reported with non-missing counts and the observed levels.

summarizeTimepointsMethylationGLMM_T1T2(
  data,
  timeVar = "Timepoint",
  phenotypes,
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_methylationGLMM_T1T2.txt"
)

Arguments

data

Data frame containing the longitudinal phenotype-plus-beta data.

timeVar

Character. Name of the time variable.

phenotypes

Character vector or comma-separated string of phenotype variables to summarize.

verbose

Logical. If TRUE, emit progress messages with message().

logs

Logical. If TRUE, write the same messages to a log file.

log_dir

Character or NULL. Directory used for the log file when logs = TRUE.

log_file

Character. File name used when logs = TRUE.

Value

A data frame with one row per timepoint and summary columns for each requested phenotype.

Examples

ex <- dnaEPICO:::exampleMethylationGLMMStateDnaEpico()
timepoint_summary <- summarizeTimepointsMethylationGLMM_T1T2(
  data = ex$preparedData$data,
  timeVar = "Timepoint",
  phenotypes = "score",
  verbose = FALSE,
  logs = FALSE
)
nrow(timepoint_summary)
#> [1] 2