aba_evaluate | R Documentation |
This function lets you evaluate the performance of a fitted aba model on new data.
aba_evaluate(model, data)
model |
a fitted aba model. The model to test on new data |
data |
dataframe. The new data on which the fitted model will be tested. |
an object with class 'abaEvaluate' which contains model performance on the data
# create separate training and testing datasets
data <- adnimerge %>% dplyr::filter(VISCODE == 'bl')
train_id <- sample(nrow(data), 0.8*nrow(data), replace = FALSE)
data_train <- data %>% dplyr::filter(dplyr::row_number() %in% train_id)
data_test <- data %>% dplyr::filter(dplyr::row_number() %in% train_id)
# fit model on train data
model <- aba_model() %>%
set_data(data_train) %>%
set_groups(
everyone(),
DX_bl %in% c('MCI', 'AD')
) %>%
set_outcomes(CDRSB_bl, MMSE_bl) %>%
set_predictors(
PLASMA_PTAU181_bl, PLASMA_NFL_bl,
c(PLASMA_PTAU181_bl, PLASMA_NFL_bl)
) %>%
set_covariates(AGE, GENDER, EDUCATION) %>%
set_stats('lm') %>%
fit()
# evaluate fitted model on test data
res <- model %>% aba_evaluate(data = data_test)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.