Description
Patients were randomized to receive one of two daily doses (low or high) of a new treatment for Alzheimer’s disease or a placebo in a study.
Each patient returned to the clinic every 2 months for 1 year for assessment of disease progression based on cognitive measurements on the Alzheimer’s Disease Assessment Scale (ADAS).
This test evaluates memory, language, and praxis function, and is based on the sum of scores from an 11-item scale, with a potential range of 0 to 70, higher scores indicative of greater disease severity.
The primary goal is to determine if the rate of disease progression is slowed with active treatment compared with a placebo.
Is there a difference in response profiles over time among the three groups?
Column 1: Treatment ID (L = Low dose, H = High dose, P = Placebo)
Column 2: Patient ID
Column 3: ADAS score at month 2
Column 4: ADAS score at month 4
Column 5: ADAS score at month 6
Column 6: ADAS score at month 8
Column 7: ADAS score at month 10
Column 8: ADAS score at month 12
plot
p <- ggplot(dta2L, aes(Time_f, ADAS,
group = Treatment,
linetype = Treatment,
shape = Treatment)) +
stat_summary(fun = mean, geom = "line") +
stat_summary(fun = mean, geom = "point") +
stat_summary(fun.data = mean_se, geom = "errorbar", width = 0.2) +
scale_shape_manual(values=c(1, 2, 7)) +
scale_y_continuous(breaks=seq(20, 60, 10))+
labs(x = "Month", y = "ADAS", linetype = "Treatment", shape = "Treatment") +
theme_minimal() +
theme(legend.position=c(.15,.85))
suppressWarnings(suppressMessages(print(p)))

dta2w <- read.table("C:/Users/HANK/Desktop/HOMEWORK/adas.txt", h=T, na.strings='.')
dta2w <- dta2w %>%
mutate(Baseline= adas02)
dta2w %>%
dplyr::group_by(Treatment) %>%
dplyr::select(starts_with("adas")) %>%
furniture::table1(digits=2, total=FALSE, test=F, output="html")
## Adding missing grouping variables: `Treatment`
## Using dplyr::group_by() groups: Treatment
|
|
H
|
L
|
P
|
|
|
n = 18
|
n = 17
|
n = 21
|
|
adas02
|
|
|
|
|
|
30.22 (8.56)
|
32.82 (7.51)
|
29.62 (6.78)
|
|
adas04
|
|
|
|
|
|
32.44 (7.33)
|
35.12 (8.64)
|
33.43 (6.42)
|
|
adas06
|
|
|
|
|
|
33.56 (8.56)
|
37.65 (9.09)
|
34.86 (6.43)
|
|
adas08
|
|
|
|
|
|
33.33 (9.06)
|
36.41 (11.09)
|
36.38 (6.34)
|
|
adas10
|
|
|
|
|
|
33.72 (7.44)
|
38.35 (11.19)
|
37.57 (7.03)
|
|
adas12
|
|
|
|
|
|
34.28 (7.10)
|
39.18 (10.77)
|
39.05 (8.80)
|
Covariance and correlation
knitr::kable(cor(dta2w[,3:8], use="pair"))
| adas02 |
1.0000000 |
0.8954000 |
0.7544220 |
0.7740050 |
0.7006653 |
0.7496129 |
| adas04 |
0.8954000 |
1.0000000 |
0.8144181 |
0.7936916 |
0.7006978 |
0.7400989 |
| adas06 |
0.7544220 |
0.8144181 |
1.0000000 |
0.8628966 |
0.6716075 |
0.7615946 |
| adas08 |
0.7740050 |
0.7936916 |
0.8628966 |
1.0000000 |
0.8472388 |
0.8337049 |
| adas10 |
0.7006653 |
0.7006978 |
0.6716075 |
0.8472388 |
1.0000000 |
0.9153379 |
| adas12 |
0.7496129 |
0.7400989 |
0.7615946 |
0.8337049 |
0.9153379 |
1.0000000 |
scatterplotMatrix(~ adas02 + adas04 + adas06 + adas08 + adas10 + adas12 | Treatment,
data=dta2w,
col="gray",
smooth=FALSE,
by.group = TRUE,
regLine=FALSE,
ellipse=list(levels=c(.975),
fill=TRUE,
fill.alpha=.1),
diagonal = T,
pch = c(1, 19, 21))
## Warning in scatterplotMatrix.default(X[, -ncol], groups = X[, ncol], ...): number of groups exceeds number of available colors
## colors are recycled

m_aov <- afex::aov_car(ADAS ~ Treatment*Time_f + Error(PID/Time_f), data=dta2L)
## Warning: Missing values for following ID(s):
## 1, 7, 11, 12, 13, 24, 26, 27, 30, 31, 35, 41, 42, 45, 47, 48, 51, 52, 54, 61, 68, 70, 72, 74
## Removing those cases from the analysis.
## Contrasts set to contr.sum for the following variables: Treatment
knitr::kable(nice(m_aov))
| Treatment |
2, 53 |
328.01 |
1.10 |
.032 |
.342 |
| Time_f |
3.27, 173.16 |
25.22 |
18.57 *** |
.066 |
<.001 |
| Treatment:Time_f |
6.53, 173.16 |
25.22 |
1.35 |
.010 |
.234 |
emmeans(m_aov, ~ Time_f | Treatment)
## Treatment = H:
## Time_f emmean SE df lower.CL upper.CL
## X0 30.2 1.93 82.6 26.4 34.1
## X2 32.4 1.93 82.6 28.6 36.3
## X4 33.5 1.93 82.6 29.7 37.4
## X6 33.3 1.93 82.6 29.5 37.2
## X8 33.7 1.93 82.6 29.9 37.6
## X10 34.3 1.93 82.6 30.4 38.1
##
## Treatment = L:
## Time_f emmean SE df lower.CL upper.CL
## X0 32.8 1.96 83.8 28.9 36.7
## X2 35.1 1.96 83.8 31.2 39.0
## X4 37.6 1.96 83.8 33.7 41.5
## X6 36.4 1.96 83.8 32.5 40.3
## X8 38.3 1.96 83.8 34.4 42.2
## X10 39.2 1.96 83.8 35.3 43.1
##
## Treatment = P:
## Time_f emmean SE df lower.CL upper.CL
## X0 29.6 1.87 79.5 25.9 33.3
## X2 33.4 1.87 79.5 29.7 37.1
## X4 34.8 1.87 79.5 31.1 38.6
## X6 36.4 1.87 79.5 32.7 40.1
## X8 37.6 1.87 79.5 33.8 41.3
## X10 39.0 1.87 79.5 35.3 42.7
##
## Warning: EMMs are biased unless design is perfectly balanced
## Confidence level used: 0.95
xyplot(ADAS ~ Baseline | as.factor(Time_f), groups=Treatment, data=dta2L,
type=c("p","r","g"), layout=c(6,1),
xlab="Baseline ADAS",
ylab="ADAS",
auto.key = TRUE)

dta2L$trt_time <- dta2L$Time_f
dta2L$trt_time[dta2L$Treatment=="P"] <- "0"
dta2L$Time_f <- relevel(dta2L$Time_f, ref="0")
dta2L$trt_time <- relevel(dta2L$trt_time, ref="0")
str(dta2L)
## 'data.frame': 480 obs. of 7 variables:
## $ Treatment: Factor w/ 3 levels "H","L","P": 2 2 2 2 2 2 2 2 2 2 ...
## $ PID : Factor w/ 80 levels "1","2","3","4",..: 1 5 8 12 13 15 19 21 24 28 ...
## $ Baseline : num 22 34 40 24 29 31 22 43 18 25 ...
## $ Month : Factor w/ 6 levels "10","12","2",..: 3 3 3 3 3 3 3 3 3 3 ...
## $ ADAS : num 22 34 40 24 29 31 22 43 18 25 ...
## $ Time_f : Factor w/ 6 levels "0","2","4","6",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ trt_time : Factor w/ 6 levels "0","2","4","6",..: 1 1 1 1 1 1 1 1 1 1 ...