level=0: group-level estimates level=1: individual-level estimates level=2: individual-level observations
Usage
aba_plot_trajectory(
model,
time_at = NULL,
at = NULL,
expand = NULL,
reduce_fn = mean,
include_ranef = FALSE,
time_label = "Time",
outcome_label = "Outcome",
include_basic = TRUE
)
Examples
data <- aba::adnimerge %>%
filter(
AGE > 20,
YEARS_bl <= 3.5,
DX_bl == 'MCI'
)
#> Error: object 'YEARS_bl' not found
data_bl <- data %>% filter(VISCODE == 'bl')
#> Error in attr(data, "tsp") <- c(start, end, frequency): object is not a matrix
model <- data %>%
rename(XID = RID) %>%
aba_model() %>%
set_outcomes(ADAS13, CDRSB) %>%
set_predictors(c(AGE, CSF_ABETA_bl)) %>%
set_stats(
stat_lme(id = 'XID', time = 'YEARS_bl', poly=2)
) %>%
fit()
#> Error in rename(., XID = RID): could not find function "rename"
model %>%
aba_plot_trajectory(
time_at=seq(0,3,length.out=20)
)
#> Error in eval(expr, envir, enclos): object 'model' not found
model %>%
aba_plot_trajectory(
time_at=seq(0,3,length.out=20),
include_ranef = T
)
#> Error in eval(expr, envir, enclos): object 'model' not found
# two different stats
model <- data %>%
rename(XID = RID) %>%
aba_model() %>%
set_outcomes(ADAS13, CDRSB) %>%
set_predictors(c(AGE, CSF_ABETA_bl)) %>%
set_stats(
stat_lme(id = 'XID', time = 'YEARS_bl'),
stat_lme(id = 'XID', time = 'YEARS_bl', poly=2)
) %>%
fit()
#> Error in rename(., XID = RID): could not find function "rename"
# two different stats
model %>%
aba_plot_trajectory(
time_at=seq(0,3,length.out=20),
include_ranef = T
)
#> Error in eval(expr, envir, enclos): object 'model' not found
# two stats and "at" vars
model %>%
aba_plot_trajectory(
time_at=seq(0,3,length.out=20),
include_ranef = T,
at = list('AGE'=c(50,80))
)
#> Error in eval(expr, envir, enclos): object 'model' not found