-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaba_plot_trajectory.Rd
More file actions
83 lines (75 loc) · 1.6 KB
/
aba_plot_trajectory.Rd
File metadata and controls
83 lines (75 loc) · 1.6 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/aba_grid.R
\name{aba_plot_trajectory}
\alias{aba_plot_trajectory}
\title{Plot trajectories of fitted longitudinal stats}
\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
)
}
\arguments{
\item{level}{}
}
\description{
level=0: group-level estimates
level=1: individual-level estimates
level=2: individual-level observations
}
\examples{
data <- aba::adnimerge \%>\%
filter(
AGE > 20,
YEARS_bl <= 3.5,
DX_bl == 'MCI'
)
data_bl <- data \%>\% filter(VISCODE == 'bl')
model <- data \%>\%
aba_model() \%>\%
set_outcomes(ADAS13, CDRSB) \%>\%
set_predictors(c(AGE, CSF_ABETA_bl)) \%>\%
set_stats(
stat_lme(id = 'RID', time = 'YEARS_bl', poly=2)
) \%>\%
fit()
model \%>\%
aba_plot_trajectory(
time_at=seq(0,3,length.out=20)
)
model \%>\%
aba_plot_trajectory(
time_at=seq(0,3,length.out=20),
include_ranef = T
)
# two different stats
model <- data \%>\%
aba_model() \%>\%
set_outcomes(ADAS13, CDRSB) \%>\%
set_predictors(c(AGE, CSF_ABETA_bl)) \%>\%
set_stats(
stat_lme(id = 'RID', time = 'YEARS_bl'),
stat_lme(id = 'RID', time = 'YEARS_bl', poly=2)
) \%>\%
fit()
# two different stats
model \%>\%
aba_plot_trajectory(
time_at=seq(0,3,length.out=20),
include_ranef = T
)
# 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))
)
}