Groups are the filtered subsets of data which you want to fit statistical models on. This function supports both string inputs and logical functions of variables (provided that the data is already set for the aba model). The inputs should be separated by a comma, where each input is a different group. You can also specify labels for each group.
An aba model. The model for which you want to set groups.
comma-separated strings or logical expressions. This specifies the subsets of the data by which the aba model will filter.
vector of strings. Optional labels for printing & plotting.
"everyone()" can be used to specify a group with
no filtering. This can be useful when you want to fit models on the entire
group and on a sub-group.
An aba model with groups set to the given input.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
data <- adnimerge %>% dplyr::filter(VISCODE == 'bl') # set groups based on logical expressions. Here, data must be supplied first. model <- data %>% aba_model() %>% set_groups( everyone(), DX_bl == 'CU', (DX_bl %in% c('MCI','AD')) & (CSF_ABETA_bl < 880) ) print(model) # specify labels which will be used later for printing & plotting model <- data %>% aba_model() %>% set_groups( everyone(), DX_bl == 'CU', (DX_bl %in% c('MCI','AD')) & (CSF_ABETA_bl < 880), labels = c('All participants', 'CU-only', 'Ab+ MCI & AD') ) print(model) # set groups based on strings. No data is required to be supplied first. model <- aba_model() %>% set_groups( "everyone()", "DX_bl == 'CU'", "(DX_bl %in% c('MCI','AD')) & (CSF_ABETA_bl < 880)" ) print(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.