#' Calculate age acceleration
#'
#' @param x,model,calibrate,transform,adjust See \code{\link{meffonym.score}}.
#' @param age Chronological age in years.
#' @return Age-adjusted model scores.
#'
#' @export
meffonym.accel <- function(
x,
model,
age,
calibrate=F,
transform=ifelse(model %in% c("horvath","pedbe"), anti.trafo, NULL),
adjust=NULL) {
stopifnot(length(age) == nrow(x))
if (is.null(adjust))
adjust <- data.frame(age=age)
else {
stopifnot(is.matrix(adjust) || is.data.frame(adjust))
stopifnot(nrow(adjust) == length(age))
adjust <- cbind(adjust, age=age)
}
meffyonym.score(x,model,adjust)$score
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.