-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdditionalPlots.qmd
469 lines (371 loc) · 14.5 KB
/
AdditionalPlots.qmd
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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
---
title: "Additional Plots"
author: "J Bridge"
format:
html:
self-contained: true
embed-resources: true
code-fold: true
code-summary: "Show code"
code-tools: true
code-link: true
code-line-numbers: true
code-copy: true
keep-md: true
execute:
warning: false
fig-dpi: 160
---
```{r}
library(RiskCom)
library(ggplot2)
```
# Urinary function waffle plots
::: panel-tabset
## Urinary problem
::: panel-tabset
### Baseline
```{r}
waffles(
icons = c("veryhappy", "happy", "neutral", "sad", "verysad"),
percentages = c(72, 21, 5, 2, 0),
legend = c("No problem", "Very small problem", "Small problem", "Moderate problem", "Big problem")
)
```
### 12 months
```{r}
waffles(
icons = c("veryhappy", "happy", "neutral", "sad", "verysad"),
percentages = c(39, 38, 14, 6, 3),
legend = c("No problem", "Very small problem", "Small problem", "Moderate problem", "Big problem")
)
```
:::
## Leakage
::: panel-tabset
### Baseline
```{r}
waffles(
icons = c("sun", "raindrop1", "raindrop2", "raindrop3", "raindrop4"),
percentages = c(77, 9, 5, 5, 4),
legend = c("Rarely or never leaking", "Leaking once a week", "Leaking more than once a week", "Leaking once a day", "Leaking more than once a day")
)
```
### 12 months
```{r}
waffles(
icons = c("sun", "raindrop1", "raindrop2", "raindrop3", "raindrop4"),
percentages = c(44, 15, 11, 12, 18),
legend = c("Rarely or never leaking", "Leaking once a week", "Leaking more than once a week", "Leaking once a day", "Leaking more than once a day")
)
```
:::
## Pad-use
::: panel-tabset
### Baseline
```{r}
waffles(
icons = c("underwear", "pad1", "pad2", "pad3"),
percentages = c(96, 2, 1, 1),
legend = c("No pads per day", "One pad per day", "Two pads per day", "Three or more pads per day")
)
```
### 12 months
```{r}
waffles(
icons = c("underwear", "pad1", "pad2", "pad3"),
percentages = c(65, 26, 5, 4),
legend = c("No pads per day", "One pad per day", "Two pads per day", "Three or more pads per day")
)
```
:::
## Urinary problem & leakage
::: panel-tabset
### Baseline
```{r}
icons1 = c("sun", "raindrop1", "raindrop2", "raindrop3", "raindrop4")
icons2 = c("veryhappy", "happy", "neutral", "sad", "verysad")
legend1 = c("Rarely or never leaking", "Leaking once a week", "Leaking more than once a week", "Leaking once a day", "Leaking more than once a day")
legend2 = c("No problem", "Very small problem", "Small problem", "Moderate problem", "Big problem")
percentages = c(70,9,0,0,0, 2,6,0,0,0, 0,3,1,0,0, 1,2,2,0,0, 0,1,2,1,0)
waffles(icons=icons1, legend=legend1, percentages=percentages,
icons2=icons2, legend2=legend2)
```
### 12 months
```{r}
icons1 = c("sun", "raindrop1", "raindrop2", "raindrop3", "raindrop4")
icons2 = c("veryhappy", "happy", "neutral", "sad", "verysad")
legend1 = c("Rarely or never leaking", "Leaking once a week", "Leaking more than once a week", "Leaking once a day", "Leaking more than once a day")
legend2 = c("No problem", "Very small problem", "Small problem", "Moderate problem", "Big problem")
percentages = c(33,13,0,0,0, 3,11,2,0,0, 0,6,4,0,0, 1,5,3,1,0, 1,4,5,5,3)
waffles(icons=icons1, legend=legend1, percentages=percentages,
icons2=icons2, legend2=legend2)
```
:::
## Urinary problem & pad-use
::: panel-tabset
### Baseline
```{r}
icons1 = c("underwear", "pad1", "pad2", "pad3")
icons2 = c("veryhappy", "happy", "neutral", "sad", "verysad")
legend1 = c("No pads per day", "One pad per day", "Two pads per day", "Three or more pads per day")
legend2 = c("No problem", "Very small problem", "Small problem", "Moderate problem", "Big problem")
percentages = c(73,20,4,1,0, 0,1,1,0,0, 0,0,0,0,0, 0,0,0,0,0)
waffles(icons=icons1, legend=legend1, percentages=percentages,
icons2=icons2, legend2=legend2)
```
### 12 months
```{r}
icons1 = c("underwear", "pad1", "pad2", "pad3")
icons2 = c("veryhappy", "happy", "neutral", "sad", "verysad")
legend1 = c("No pads per day", "One pad per day", "Two pads per day", "Three or more pads per day")
legend2 = c("No problem", "Very small problem", "Small problem", "Moderate problem", "Big problem")
percentages = c(34,24,4,1,0, 3,13,8,2,1, 0,0,2,2,1, 0,0,1,2,2)
waffles(icons=icons1, legend=legend1, percentages=percentages,
icons2=icons2, legend2=legend2)
```
:::
## Leakage & Pad-use
::: panel-tabset
### Baseline
```{r}
icons1 = c("underwear", "pad1", "pad2", "pad3")
icons2 = c("sun", "raindrop1", "raindrop2", "raindrop3", "raindrop4")
legend1 = c("No pads per day", "One pad per day", "Two pads per day", "Three or more pads per day")
legend2 = c("Rarely or never leaking", "Leaking once a week", "Leaking more than once a week", "Leaking once a day", "Leaking more than once a day")
percentages = c(76,8,4,5,3, 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,1)
waffles(icons=icons1, legend=legend1, percentages=percentages,
icons2=icons2, legend2=legend2)
```
### 12 months
```{r}
icons1 = c("underwear", "pad1", "pad2", "pad3")
icons2 = c("sun", "raindrop1", "raindrop2", "raindrop3", "raindrop4")
legend1 = c("No pads per day", "One pad per day", "Two pads per day", "Three or more pads per day")
legend2 = c("Rarely or never leaking", "Leaking once a week", "Leaking more than once a week", "Leaking once a day", "Leaking more than once a day")
percentages = c(42,11,6,4,2, 3,3,4,7,9, 0,0,0,1,4, 0,0,0,0,4)
waffles(icons=icons1, legend=legend1, percentages=percentages,
icons2=icons2, legend2=legend2)
```
:::
:::
# Leak free and pad free at baseline
::: panel-tabset
## Leakage
```{r}
waffles(
icons = c("sun", "raindrop1", "raindrop2", "raindrop3", "raindrop4"),
percentages = c(51,15,10,11,13),
legend = c("Rarely or never leaking", "Leaking once a week", "Leaking more than once a week", "Leaking once a day", "Leaking more than once a day")
)
```
## Pad-use
```{r}
waffles(
icons = c("underwear", "pad1", "pad2", "pad3"),
percentages = c(70,24,3,3),
legend = c("No pads per day", "One pad per day", "Two pads per day", "Three or more pads per day")
)
```
## Leakage and pad use
```{r}
icons1 = c("underwear", "pad1", "pad2", "pad3")
icons2 = c("sun", "raindrop1", "raindrop2", "raindrop3", "raindrop4")
legend1 = c("No pads per day", "One pad per day", "Two pads per day", "Three or more pads per day")
legend2 = c("Rarely or never leaking", "Leaking once a week", "Leaking more than once a week", "Leaking once a day", "Leaking more than once a day")
percentages = c(48,11,6,4,1, 2,3,5,7,7, 0,0,0,1,3, 0,0,0,0,2)
waffles(icons=icons1, legend=legend1, percentages=percentages,
icons2=icons2, legend2=legend2)
```
:::
# Sexual function waffle plots
::: panel-tabset
## Sexual function problem
::: panel-tabset
### Baseline
```{r}
waffles(
icons = c("veryhappy", "happy", "neutral", "sad", "verysad"),
percentages = c(48, 18, 17, 11, 6),
legend = c("No problem", "Very small problem", "Small problem", "Moderate problem", "Big problem")
)
```
### 12 months
```{r}
waffles(
icons = c("veryhappy", "happy", "neutral", "sad", "verysad"),
percentages = c(19, 18, 21, 23, 19),
legend = c("No problem", "Very small problem", "Small problem", "Moderate problem", "Big problem")
)
```
:::
## Erection quality
::: panel-tabset
### Baseline
```{r}
waffles(
icons = c("dot5", "dot3", "dot2", "dot1"),
percentages = c(57, 23, 10, 10),
legend = c("Firm enough for intercourse", "Firm enough for masturbation and foreplay only", "Not firm enough for any sexual activity", "None at all")
)
```
### 12 months
```{r}
waffles(
icons = c("dot5", "dot3", "dot2", "dot1"),
percentages = c(10, 24, 17, 49),
legend = c("Firm enough for intercourse", "Firm enough for masturbation and foreplay only", "Not firm enough for any sexual activity", "None at all")
)
```
:::
## Erection quality and assistance
::: panel-tabset
### Baseline
```{r}
icons1 = c("dot5", "dot3", "dot2", "dot1")
icons2 = c("blank", "pill")
legend1 = c("Firm enough for intercourse", "Firm enough for masturbation and foreplay only", "Not firm enough for any sexual activity", "None at all")
legend2 = c("", "Used medication or device")
percentages = c(52,5, 19,4, 8,2, 9,1)
waffles(icons=icons1, legend=legend1, percentages = percentages ,
icons2=icons2, legend2=legend2,
offset_x=0, offset_y=0, icon_size2 = 0.06)
```
### 12 months
```{r}
icons1 = c("dot5", "dot3", "dot2", "dot1")
icons2 = c("blank", "pill")
legend1 = c("Firm enough for intercourse", "Firm enough for masturbation and foreplay only", "Not firm enough for any sexual activity", "None at all")
legend2 = c("", "Used medication or device")
percentages = c(3,7, 6,18, 6,11, 23,26)
waffles(icons=icons1, legend=legend1, percentages = percentages,
icons2=icons2, legend2=legend2,
offset_x=0, offset_y=0, icon_size2 = 0.06)
```
:::
:::
# Natural erections at baseline
::: panel-tabset
## Erections
```{r}
waffles(
icons = c("dot5", "dot3", "dot2", "dot1"),
percentages = c(17,29,16,38),
legend = c("Firm enough for intercourse", "Firm enough for masturbation and foreplay only", "Not firm enough for any sexual activity", "None at all")
)
```
## Erection and medication
```{r}
icons1 = c("dot5", "dot3", "dot2", "dot1")
icons2 = c("blank", "pill")
legend1 = c("Firm enough for intercourse", "Firm enough for masturbation and foreplay only", "Not firm enough for any sexual activity", "None at all")
legend2 = c("", "Used medication or device")
percentages = c(6,11,7,22,5,11,13,25)
waffles(icons=icons1, legend=legend1, percentages = percentages,
icons2=icons2, legend2=legend2,
offset_x=0, offset_y=0, icon_size2 = 0.06)
```
:::
# Bar charts
::: panel-tabset
## Leakage and problem
::: panel-tabset
### Baseline
```{r}
Problem <- c(rep("No problem" , 5) , rep("Very small problem" , 5) , rep("Small problem" , 5) , rep("Moderate problem" , 5), rep("Big problem" , 5))
Leakage <- rep(c("Rarely or never" , "About once a week", "More than once a week", "About once a day", "More than once a day") , 5)
Frequency <- c(1374,36,8,10,3, 156,123,61,51,18, 9,13,23,31,34, 2,2,5,11,20, 1,0,0,0,14)
data <- data.frame("Problem"=factor(Problem,
levels=c("No problem","Very small problem","Small problem","Moderate problem","Big problem","Unknown")),
"Leakage"=factor(Leakage, levels=c("Rarely or never" , "About once a week", "More than once a week", "About once a day", "More than once a day"))
, "Frequency"=Frequency)
ggplot(data, aes(x=Leakage, y=Frequency)) +
geom_col(aes(fill=Problem))+
scale_x_discrete(labels=c(
"Rarely or never"="Rarely \n or never",
"About once a week"= "About once \n a week",
"More than once a week"="More than \n once a week",
"About once a day"= "About once \n a day",
"More than once a day"="More than \n once a day"
))
```
### 12 month
```{r}
Problem <- c(rep("No problem" , 5) , rep("Very small problem" , 5) , rep("Small problem" , 5) , rep("Moderate problem" , 5), rep("Big problem" , 5))
Leakage <- rep(c("Rarely or never" , "About once a week", "More than once a week", "About once a day", "More than once a day") , 5)
Frequency <- c(468,37,10,19,10, 162,152,87,94,60, 1,23,51,48,71, 0,3,3,8,64, 0,0,0,3,46)
data <- data.frame("Problem"=factor(Problem,
levels=c("No problem","Very small problem","Small problem","Moderate problem","Big problem","Unknown")),
"Leakage"=factor(Leakage, levels=c("Rarely or never" , "About once a week", "More than once a week", "About once a day", "More than once a day"))
, "Frequency"=Frequency)
ggplot(data, aes(x=Leakage, y=Frequency)) +
geom_col(aes(fill=Problem))+
scale_x_discrete(labels=c(
"Rarely or never"="Rarely \n or never",
"About once a week"= "About once \n a week",
"More than once a week"="More than \n once a week",
"About once a day"= "About once \n a day",
"More than once a day"="More than \n once a day"
))
```
:::
## Pad use and problem
::: panel-tabset
### Baseline
```{r}
Problem <- c(rep("No problem" , 4) , rep("Very small problem" , 4) , rep("Small problem" , 4) , rep("Moderate problem" , 4), rep("Big problem" , 4))
Pads <- rep(c("None" , "1/day", "2/day", ">3/day") , 5)
Frequency <- c(1427,5,2,0, 392,18,1,0, 89,14,4,3, 29,6,3,2, 4,0,1,9)
data <- data.frame("Problem"=factor(Problem,
levels=c("No problem","Very small problem","Small problem","Moderate problem","Big problem","Unknown")),
"Pads"=factor(Pads, levels=c("None" , "1/day", "2/day", ">3/day", "Unknown"))
, "Frequency"=Frequency)
ggplot(data, aes(x=Pads, y=Frequency, fill=Problem)) +
geom_col()+
scale_x_discrete(labels=c(
"None"="None",
"1/day"="1 pad \n per day",
"2/day"= "2 pads \n per day",
">3/day"="3 pads \n or more \n per day"
))
```
### 12 month
```{r}
Problem <- c(rep("No problem" , 4) , rep("Very small problem" , 4) , rep("Small problem" , 4) , rep("Moderate problem" , 4), rep("Big problem" , 4))
Pads <- rep(c("None" , "1/day", "2/day", ">3/day") , 5)
Frequency <- c(497,46,4,0, 363,183,8,5, 57,107,23,6, 10,26,23,17, 2,10,13,27)
data <- data.frame("Problem"=factor(Problem,
levels=c("No problem","Very small problem","Small problem","Moderate problem","Big problem","Unknown")),
"Pads"=factor(Pads, levels=c("None" , "1/day", "2/day", ">3/day", "Unknown"))
, "Frequency"=Frequency)
ggplot(data, aes(x=Pads, y=Frequency, fill=Problem)) +
geom_col()+
scale_x_discrete(labels=c(
"None"="None",
"1/day"="1 pad \n per day",
"2/day"= "2 pads \n per day",
">3/day"="3 pads \n or more \n per day"
))
```
:::
## Leakage and pad use
```{r}
Leakage = c(rep("Rarely or never", 4),
rep("About once a week", 4), rep("More than once a week", 4),
rep("About once a day", 4), rep("More than once a day", 4))
Pads = rep(c("None", "1 pad per day", "2 pads per day", "3 or more pads per day"), 5)
Freq = c(583,35,1,0, 158,48,1,1, 82,61,1,2, 60,99,10,1, 21,120,55,49)
data = data.frame("Leakage"=factor(Leakage, levels=c("Rarely or never", "About once a week", "More than once a week","About once a day", "More than once a day")), "Pads"=factor(Pads, levels=c("None", "1 pad per day", "2 pads per day", "3 or more pads per day")), "Freq"=Freq)
ggplot(data, aes(fill=Pads, y=Freq, x=Leakage))+
geom_col()+
ylab("Number of participants")+
scale_x_discrete(labels=c(
"Rarely or never"="Rarely \n or never",
"About once a week"= "About once \n a week",
"More than once a week"="More than \n once a week",
"About once a day"="About once \n a day",
"More than once a day"="More than \n once a day",
"Missing"="Missing"
))
```
:::