Evaluates the statistical consistency and reliability of repeated thermal measurements. The function calculates the Intraclass Correlation Coefficient (ICC) and performs variance decomposition using Linear Mixed Models (LMM) to assess the proportion of variance attributable to between-subject differences versus measurement error.
Usage
assess_replicates(
data,
id_col,
metrics,
replicate_col = NULL,
sort_cols = NULL,
methods = "icc",
return_models = FALSE,
quiet = FALSE
)Arguments
- data
A data.frame containing the thermal metrics and identifier columns.
- id_col
A single character string specifying the column name for subject IDs.
- metrics
A character vector specifying the column names of the thermal metrics to be assessed.
- replicate_col
A single character string specifying the column name for the replicate index. Default is
NULL. IfNULL, replicate indices are inferred from row order.- sort_cols
A character vector specifying the columns to sort the data by before inferring replicate indices. Default is
NULL.- methods
A character vector specifying the statistical methods to apply. Valid options include
"icc","variance", and"lmm". Default is"icc".- return_models
Logical. If
TRUEand"lmm"is inmethods, the fitted linear mixed models are returned. Default isFALSE.- quiet
Logical. If
TRUE, console messages are suppressed. Default isFALSE.
Value
An object of class BioThermR_replicate_assessment, which is a list containing:
- settings
A list of the input parameters used for the assessment.
- icc
A data.frame containing ICC results (if
"icc"is selected).- variance
A data.frame containing variance decomposition results (if
"variance"is selected).- lmm
A data.frame containing fixed effects and variance components from LMM (if
"lmm"is selected).- models
A list of fitted
lmermodel objects (ifreturn_models = TRUE).