Skip to contents

Fit a linear or GAM model to RoC scores and return the fitted values.

Usage

make_trend(data_source, sel_method = c("linear", "non_linear"))

Arguments

data_source

data.frame with columns ROC and Age.

sel_method

character. Which trend to fit:

  • "linear" - a linear model fitted between RoC and age.

  • "non_linear" - a conservative GAM (RoC ~ s(age, k = 3)) using the mgcv package.

Value

numeric vector of fitted values, one per row of data_source.