-
Notifications
You must be signed in to change notification settings - Fork 0
/
Progression.raw.Rmd
255 lines (207 loc) · 7.19 KB
/
Progression.raw.Rmd
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
---
title: "Progression in mFARS/SARA/ICARS"
author: "Christian Rummey"
date: "`r Sys.Date()`"
output:
word_document:
toc: yes
number_sections: yes
html_document:
toc: yes
df_print: paged
number_sections: yes
editor_options:
chunk_output_type: console
markdown:
wrap: 100
---
```{r global_options, include=FALSE}
knitr::opts_chunk$set(fig.width=9, fig.height=4, fig.align='center', echo=F, warning=F, message=F, cache=F)
# parlist <- c('mFARS','SARA','ICARS','FARS.E','SARA.ax','ICARS.ax','FARS.BC','FARS.B','SARA.ki','SARA.ku' ,'ICARS.ki')
# age.grps <- c(0,8,16,25,40,100)
# age.lbls <- c('<8y', '8-15y', '16-24y', '25-40y', '>40y' )
parlist <- c('mFARS','SARA','ICARS','FARS.E','SARA.ax','ICARS.ax','FARS.BC','SARA.ki','ICARS.ki')
age.grps <- c(0,8,12,16,25,40,100)
age.lbls <- c('<8y', '8-11y', '12-15y', '16-24y', '25-40y', '>40y' )
dt. <- readRDS('DATA derived/dt.chg.rds') %>%
mutate(paramcd = factor(paramcd, parlist)) %>%
filter(!is.na(paramcd)) %>%
# filter(forslope == 1) %>%
# select(-c('forslope', 'int', 'chg', 'dev.y')) %>%
droplevels()
dt. %<>%
left_join(.rt('../DATA other/scales.txt') %>% select(paramcd, maxscore)) %>%
mutate(paramcd = factor(paramcd, parlist)) %>%
mutate( age.grp = cut(age, age.grps, labels = age.lbls, right = T))
```
# Methods
- General methodology follows the longitudinal changes analyses (latest paper)
- Scores were analyzed in parallel, both on the absolute scale, and using the percentage of total
- \% of Total Changes were added for Comparison
- y-axis of percentual Changes and SRMs were capped (20% and 1.2, respectively, for better comparison)
# Results
## Total mFARS, SARA, ICARS
```{r}
scores.list <- c('mFARS','SARA','ICARS')
tmp.pct <- dt. %>%
filter ( !is.na( int )) %>%
filter ( type == 'pct') %>%
filter ( int == '1y' ) %>%
group_by(paramcd, age.grp, amb, int ) %>%
filter ( paramcd %in% scores.list ) %>%
summarise(n = n(), m = mean(chg), sd = sd(chg), SRM = m/sd)
tmp.val <- dt. %>%
filter ( !is.na( int )) %>%
filter ( type == 'val') %>%
filter ( int == '1y' ) %>%
group_by(paramcd, age.grp, amb, int ) %>%
filter ( paramcd %in% scores.list ) %>%
summarise(n = n(), m = mean(chg), sd = sd(chg), SRM = m/sd)
label.y.pct <- -max(tmp.pct$m)*.1
label.y.val <- -max(tmp.val$m)*.1
A <- tmp.val %>%
ggplot()+geom_col(position = position_dodge(width = .6), alpha = .8)+
aes(x = age.grp, y = m)+
aes(fill = paramcd)+
facet_grid(.~amb)+
geom_text(aes(label=n, y = label.y.pct), position = position_dodge(width = .6), size = 2)+
geom_hline(yintercept = 0, linetype = 'dotted')+
.leg_tr+
ggtitle('Changes in Total Scores (absolute)')+
ylab('Mean Change')+
xlab('Age Group')
B <- tmp.pct %>%
ggplot()+geom_col(position = position_dodge(width = .6), alpha = .8)+
aes(x = age.grp, y = m)+
aes(fill = paramcd)+
facet_grid(.~amb)+
geom_text(aes(label=n, y = label.y.pct), position = position_dodge(width = .6), size = 2)+
geom_hline(yintercept = 0, linetype = 'dotted')+
.leg_none+
ggtitle('Changes in Total Scores (percentage)')+
ylab('Mean Percentage Change')+
xlab('Age Group')
C <- tmp.pct %>%
ggplot()+geom_col(position = position_dodge(width = .6), alpha = .8)+
aes(x = age.grp, y = SRM)+
aes(fill = paramcd)+
facet_grid(.~amb)+
geom_hline(yintercept = 0, linetype = 'dotted')+
.leg_none+
ggtitle('SRMs')+
xlab('SRM')+
xlab('Age Group')
A
B + coord_cartesian(ylim = c( 0, 20))
C + coord_cartesian(ylim = c(-.1, 1.2))
```
## Axial Function, mFARS, SARA, ICARS
```{r}
scores.list <- c('FARS.E','SARA.ax','ICARS.ax')
tmp.pct <- dt. %>%
filter ( !is.na( int )) %>%
filter ( type == 'pct') %>%
filter ( int == '1y' ) %>%
group_by(paramcd, age.grp, amb, int ) %>%
filter ( paramcd %in% scores.list ) %>%
summarise(n = n(), m = mean(chg), sd = sd(chg), SRM = m/sd)
tmp.val <- dt. %>%
filter ( !is.na( int )) %>%
filter ( type == 'val') %>%
filter ( int == '1y' ) %>%
group_by(paramcd, age.grp, amb, int ) %>%
filter ( paramcd %in% scores.list ) %>%
summarise(n = n(), m = mean(chg), sd = sd(chg), SRM = m/sd)
label.y.pct <- -max(tmp.pct$m)*.1
label.y.val <- -max(tmp.val$m)*.1
A <- tmp.val %>%
ggplot()+geom_col(position = position_dodge(width = .6), alpha = .8)+
aes(x = age.grp, y = m)+
aes(fill = paramcd)+
facet_grid(.~amb)+
geom_text(aes(label=n, y = label.y.val), position = position_dodge(width = .6), size = 2)+
geom_hline(yintercept = 0, linetype = 'dotted')+
.leg_tr+
ggtitle('Changes in Total Scores (absolute)')+
ylab('Mean Change')+
xlab('Age Group')
B <- tmp.pct %>%
ggplot()+geom_col(position = position_dodge(width = .6), alpha = .8)+
aes(x = age.grp, y = m)+
aes(fill = paramcd)+
facet_grid(.~amb)+
geom_text(aes(label=n, y = label.y.pct), position = position_dodge(width = .6), size = 2)+
geom_hline(yintercept = 0, linetype = 'dotted')+
.leg_none+
ggtitle('Changes in Total Scores (percentage)')+
ylab('Mean Percentage Change')+
xlab('Age Group')
C <- tmp.pct %>%
ggplot()+geom_col(position = position_dodge(width = .6), alpha = .8)+
aes(x = age.grp, y = SRM)+
aes(fill = paramcd)+
facet_grid(.~amb)+
geom_hline(yintercept = 0, linetype = 'dotted')+
.leg_none+
ggtitle('SRMs')+
xlab('SRM')+
xlab('Age Group')
A
B + coord_cartesian(ylim = c( 0, 20))
C + coord_cartesian(ylim = c(-.1, 1.2))
```
## Appendicular Function, mFARS, SARA, ICARS
```{r}
scores.list <- c('FARS.BC','SARA.ki','ICARS.ki')
tmp.pct <- dt. %>%
filter ( !is.na( int )) %>%
filter ( type == 'pct') %>%
filter ( int == '1y' ) %>%
group_by(paramcd, age.grp, amb, int ) %>%
filter ( paramcd %in% scores.list ) %>%
summarise(n = n(), m = mean(chg), sd = sd(chg), SRM = m/sd)
tmp.val <- dt. %>%
filter ( !is.na( int )) %>%
filter ( type == 'val') %>%
filter ( int == '1y' ) %>%
group_by(paramcd, age.grp, amb, int ) %>%
filter ( paramcd %in% scores.list ) %>%
summarise(n = n(), m = mean(chg), sd = sd(chg), SRM = m/sd)
label.y.pct <- -max(tmp.pct$m)*.1
label.y.val <- -max(tmp.val$m)*.1
A <- tmp.val %>%
ggplot()+geom_col(position = position_dodge(width = .6), alpha = .8)+
aes(x = age.grp, y = m)+
aes(fill = paramcd)+
facet_grid(.~amb)+
geom_text(aes(label=n, y = label.y.val), position = position_dodge(width = .6), size = 2)+
geom_hline(yintercept = 0, linetype = 'dotted')+
.leg_tr+
ggtitle('Changes in Total Scores (absolute)')+
ylab('Mean Change')+
xlab('Age Group')
B <- tmp.pct %>%
ggplot()+geom_col(position = position_dodge(width = .6), alpha = .8)+
aes(x = age.grp, y = m)+
aes(fill = paramcd)+
facet_grid(.~amb)+
geom_text(aes(label=n, y = label.y.pct), position = position_dodge(width = .6), size = 2)+
geom_hline(yintercept = 0, linetype = 'dotted')+
.leg_none+
ggtitle('Changes in Total Scores (percentage)')+
ylab('Mean Percentage Change')+
xlab('Age Group')
C <- tmp.pct %>%
ggplot()+geom_col(position = position_dodge(width = .6), alpha = .8)+
aes(x = age.grp, y = SRM)+
aes(fill = paramcd)+
facet_grid(.~amb)+
geom_hline(yintercept = 0, linetype = 'dotted')+
.leg_none+
ggtitle('SRMs')+
xlab('SRM')+
xlab('Age Group')
A
B + coord_cartesian(ylim = c( 0, 20))
C + coord_cartesian(ylim = c(-.1, 1.2))
```