Participants book

Packages: esmtools


With the participants’ book, you can gain a deeper understanding of participants’ response behaviors as well as the dynamic of their captured variables. In particular, for each participant, you can find key metrics like compliance rate, study duration, descriptive statistics, time series plots for the variables of interest, and many more elements. It helps investigate trends, patterns, and intra- and inter-individual differences in the data.

A participants’ book can be created using the ‘participants_book()’ function from the esmtools package. This function returns a table with each participant represented by a row in the table, allowing for easy comparison and analysis. It contains the following elements:

  • Participants’ response behaviors:
    • Minimal and maximal date: Provides the earliest and latest dates of participant data collected using the variable informed in the ‘timevar’ argument.
    • Number of valid observations: Indicates the total count of valid responses received from participants.
    • Compliance: Represents participants’ adherence to the study protocol. This can be extracted from a variable in the dataframe or computed using the ‘validvar’ and ‘obsno_max’ arguments.
  • Statistics and visualization of variables of interest: Enables the examination of specific variables chosen using the ‘focusvar’ argument. It helps to create two outputs:
    • statistics scores: can be specified in the ‘list_stats’ argument (default is ‘list_stats = c(“mean”, “sd”, “n_length”, “n_unique”)’).
    • visualizations: such as time series plots (‘ts’) and histograms(‘hist’), can be generated based on the user’s preferences (‘viz’ argument). Specifically, for each variable informed in the ‘focusvar’ argument, the user must specify the visualization set in a vector (e.g., c(‘ts’, ‘hist’)) within a list (e.g., list(c(‘ts’, ‘hist’),c(‘ts’))).

Note that any argument of the function ending with ‘var’ requires you to provide the name of the corresponding variable from the provided dataframe.

Note

To enhance readibility and sharing, an option is to generate a distinct HTML output for the participant book by utilizing the ‘html_output’ parameter (e.g., html_output=“report_examples/Codebook_table_example.html”). To see an example of an output, click here.

For more information see the documentation.

library(esmtools)

participants_book(data,
        idvar="id",
        obsnovar="obsno",
        focusvar=c("PA1","NA1"),
        timevar="start",
        validvar="valid",
        obsno_max = 60,
        viz=list(c("ts","hist"), c("ts","hist")))
Participant min_date max_date nb_answer compliance PA1.stats PA1.timeseries PA1.histogram NA1.stats NA1.timeseries NA1.histogram
1 2018-10-17 11:00:12 2018-10-30 13:00:42 41 0.68 mean = 5.46
sd = 8.72
n_length = 41
n_unique = 9
Embedded Image Embedded Image mean = 31.76
sd = 26.03
n_length = 41
n_unique = 24
Embedded Image Embedded Image
2 2018-10-17 08:00:21 2018-10-30 13:00:41 54 0.90 mean = 18.54
sd = 8.77
n_length = 54
n_unique = 30
Embedded Image Embedded Image mean = 20.61
sd = 13.86
n_length = 54
n_unique = 34
Embedded Image Embedded Image
3 2018-08-09 08:00:18 2018-08-22 12:00:34 36 0.60 mean = 20.28
sd = 7.32
n_length = 36
n_unique = 22
Embedded Image Embedded Image mean = 96.69
sd = 5.77
n_length = 36
n_unique = 11
Embedded Image Embedded Image
4 2018-08-09 09:00:21 2018-08-22 12:00:27 52 0.87 mean = 24.42
sd = 5.06
n_length = 52
n_unique = 21
Embedded Image Embedded Image mean = 8.13
sd = 5.64
n_length = 52
n_unique = 19
Embedded Image Embedded Image
5 2018-03-04 12:00:52 2018-03-17 13:00:25 31 0.52 mean = 10.81
sd = 14.07
n_length = 31
n_unique = 14
Embedded Image Embedded Image mean = 45.84
sd = 36.52
n_length = 31
n_unique = 23
Embedded Image Embedded Image
6 2018-03-04 10:00:13 2018-03-16 13:00:05 38 0.63 mean = 3.39
sd = 3.64
n_length = 38
n_unique = 9
Embedded Image Embedded Image mean = 14.21
sd = 18.42
n_length = 38
n_unique = 18
Embedded Image Embedded Image
7 2018-09-12 10:00:18 2018-09-25 10:00:32 47 0.78 mean = 3.04
sd = 3.77
n_length = 47
n_unique = 10
Embedded Image Embedded Image mean = 43.15
sd = 4.56
n_length = 47
n_unique = 18
Embedded Image Embedded Image
8 2018-09-12 08:00:08 2018-09-25 12:00:12 51 0.85 mean = 18.08
sd = 5.52
n_length = 51
n_unique = 22
Embedded Image Embedded Image mean = 51.14
sd = 5.06
n_length = 51
n_unique = 20
Embedded Image Embedded Image
9 2018-02-02 09:00:31 2018-02-15 13:00:28 24 0.40 mean = 15.25
sd = 6.87
n_length = 24
n_unique = 15
Embedded Image Embedded Image mean = 25.17
sd = 10.43
n_length = 24
n_unique = 19
Embedded Image Embedded Image
10 2018-02-02 11:00:23 2018-02-15 13:00:07 39 0.65 mean = 48.15
sd = 6.38
n_length = 39
n_unique = 22
Embedded Image Embedded Image mean = 6.82
sd = 5.1
n_length = 39
n_unique = 17
Embedded Image Embedded Image
11 2019-05-28 08:00:17 2019-06-10 12:00:15 57 0.95 mean = 1.02
sd = 0.13
n_length = 57
n_unique = 3
Embedded Image Embedded Image mean = 15.56
sd = 7.25
n_length = 57
n_unique = 26
Embedded Image Embedded Image
12 2019-05-28 08:00:16 2019-06-10 12:00:05 60 1.00 mean = 22.07
sd = 11.68
n_length = 60
n_unique = 35
Embedded Image Embedded Image mean = 2.12
sd = 2.12
n_length = 60
n_unique = 10
Embedded Image Embedded Image
13 2018-11-13 10:00:28 2018-11-26 13:00:25 55 0.92 mean = 3.33
sd = 3.5
n_length = 55
n_unique = 15
Embedded Image Embedded Image mean = 10.18
sd = 6.89
n_length = 55
n_unique = 24
Embedded Image Embedded Image
14 2018-11-13 09:00:20 2018-11-26 12:00:51 62 1.03 mean = 8.48
sd = 6.83
n_length = 62
n_unique = 21
Embedded Image Embedded Image mean = 32.92
sd = 8.16
n_length = 62
n_unique = 27
Embedded Image Embedded Image
15 2018-09-07 09:00:34 2018-09-20 12:00:29 56 0.93 mean = 83.71
sd = 3.09
n_length = 56
n_unique = 14
Embedded Image Embedded Image mean = 62.09
sd = 2.27
n_length = 56
n_unique = 12
Embedded Image Embedded Image
16 2018-09-07 08:01:03 2018-09-20 12:00:05 57 0.95 mean = 63.49
sd = 3.25
n_length = 57
n_unique = 15
Embedded Image Embedded Image mean = 42.61
sd = 3.03
n_length = 57
n_unique = 16
Embedded Image Embedded Image
17 2018-08-07 08:00:25 2018-08-20 12:00:49 34 0.57 mean = 98.53
sd = 3.22
n_length = 34
n_unique = 9
Embedded Image Embedded Image mean = 14.88
sd = 25.09
n_length = 34
n_unique = 12
Embedded Image Embedded Image
18 2018-08-07 09:00:30 2018-08-20 12:00:37 57 0.95 mean = 32.91
sd = 39.32
n_length = 57
n_unique = 22
Embedded Image Embedded Image mean = 32.33
sd = 39.61
n_length = 57
n_unique = 20
Embedded Image Embedded Image
19 2019-02-22 10:00:11 2019-03-07 12:00:33 54 0.90 mean = 31.59
sd = 2.13
n_length = 54
n_unique = 11
Embedded Image Embedded Image mean = 12.46
sd = 1.67
n_length = 54
n_unique = 9
Embedded Image Embedded Image
20 2019-02-22 09:00:10 2019-03-07 13:01:09 66 1.10 mean = 1.26
sd = 0.95
n_length = 66
n_unique = 6
Embedded Image Embedded Image mean = 10.41
sd = 4.28
n_length = 66
n_unique = 18
Embedded Image Embedded Image
21 2019-02-11 10:00:20 2019-02-24 12:00:20 32 0.53 mean = 64.81
sd = 2.87
n_length = 32
n_unique = 12
Embedded Image Embedded Image mean = 22.84
sd = 1.46
n_length = 32
n_unique = 8
Embedded Image Embedded Image
22 2019-02-11 11:00:35 2019-02-24 09:00:19 41 0.68 mean = 22.51
sd = 2.5
n_length = 41
n_unique = 12
Embedded Image Embedded Image mean = 21.88
sd = 3
n_length = 41
n_unique = 15
Embedded Image Embedded Image
23 2018-07-23 11:00:37 2018-08-05 12:00:51 45 0.75 mean = 24.4
sd = 21.14
n_length = 45
n_unique = 28
Embedded Image Embedded Image mean = 1
sd = 0
n_length = 45
n_unique = 2
Embedded Image Embedded Image
24 2018-07-23 08:00:26 2018-08-05 11:00:59 50 0.83 mean = 25.68
sd = 18.1
n_length = 50
n_unique = 32
Embedded Image Embedded Image mean = 11.72
sd = 11.72
n_length = 50
n_unique = 22
Embedded Image Embedded Image
25 2018-07-18 09:00:23 2018-07-31 12:00:07 38 0.63 mean = 64.29
sd = 35.36
n_length = 38
n_unique = 26
Embedded Image Embedded Image mean = 58.37
sd = 43.73
n_length = 38
n_unique = 16
Embedded Image Embedded Image
26 2018-07-18 08:00:26 2018-07-31 12:00:04 69 1.15 mean = 15.42
sd = 14.85
n_length = 69
n_unique = 30
Embedded Image Embedded Image mean = 17.54
sd = 18.97
n_length = 69
n_unique = 33
Embedded Image Embedded Image
27 2018-09-09 09:00:30 2018-09-22 12:00:17 51 0.85 mean = 11.76
sd = 4.15
n_length = 51
n_unique = 20
Embedded Image Embedded Image mean = 49.75
sd = 10.02
n_length = 51
n_unique = 32
Embedded Image Embedded Image
28 2018-09-09 09:00:16 2018-09-22 12:00:13 57 0.95 mean = 41.86
sd = 2.1
n_length = 57
n_unique = 12
Embedded Image Embedded Image mean = 6.65
sd = 3.53
n_length = 57
n_unique = 15
Embedded Image Embedded Image
29 2018-08-09 09:00:15 2018-08-22 12:00:54 40 0.67 mean = 34.95
sd = 2.33
n_length = 40
n_unique = 11
Embedded Image Embedded Image mean = 15.57
sd = 2.91
n_length = 40
n_unique = 11
Embedded Image Embedded Image
30 2018-08-09 08:00:28 2018-08-22 12:00:24 67 1.12 mean = 31.58
sd = 3.3
n_length = 67
n_unique = 17
Embedded Image Embedded Image mean = 1.06
sd = 0.3
n_length = 67
n_unique = 4
Embedded Image Embedded Image
31 2018-11-17 11:00:12 2018-11-30 13:00:24 56 0.93 mean = 14.62
sd = 11.42
n_length = 56
n_unique = 25
Embedded Image Embedded Image mean = 3.61
sd = 4.16
n_length = 56
n_unique = 14
Embedded Image Embedded Image
32 2018-11-17 09:00:15 2018-11-30 13:00:37 56 0.93 mean = 7.02
sd = 8.61
n_length = 56
n_unique = 19
Embedded Image Embedded Image mean = 1.09
sd = 0.48
n_length = 56
n_unique = 4
Embedded Image Embedded Image
33 2018-11-10 09:00:19 2018-11-23 13:00:25 54 0.90 mean = 10.07
sd = 2.19
n_length = 54
n_unique = 12
Embedded Image Embedded Image mean = 16.63
sd = 8.5
n_length = 54
n_unique = 27
Embedded Image Embedded Image
34 2018-11-10 09:00:24 2018-11-23 13:00:39 58 0.97 mean = 3.31
sd = 2.21
n_length = 58
n_unique = 9
Embedded Image Embedded Image mean = 16.91
sd = 4.95
n_length = 58
n_unique = 21
Embedded Image Embedded Image
35 2018-07-13 08:00:06 2018-07-26 12:00:49 53 0.88 mean = 43.77
sd = 3.77
n_length = 53
n_unique = 15
Embedded Image Embedded Image mean = 56.21
sd = 5.04
n_length = 53
n_unique = 19
Embedded Image Embedded Image
36 2018-07-13 07:59:55 2018-07-26 12:00:51 63 1.05 mean = 37.1
sd = 2.69
n_length = 63
n_unique = 13
Embedded Image Embedded Image mean = 2.24
sd = 1.74
n_length = 63
n_unique = 8
Embedded Image Embedded Image
37 2018-07-04 08:00:53 2018-07-17 12:00:14 45 0.75 mean = 6.18
sd = 2.42
n_length = 45
n_unique = 12
Embedded Image Embedded Image mean = 5.33
sd = 1.86
n_length = 45
n_unique = 10
Embedded Image Embedded Image
38 2018-07-04 10:00:34 2018-07-17 12:00:25 52 0.87 mean = 8.52
sd = 7.54
n_length = 52
n_unique = 20
Embedded Image Embedded Image mean = 86.63
sd = 16.64
n_length = 52
n_unique = 28
Embedded Image Embedded Image
39 2018-06-30 09:00:48 2018-07-13 11:00:42 39 0.65 mean = 10.05
sd = 8.08
n_length = 39
n_unique = 18
Embedded Image Embedded Image mean = 10.51
sd = 12.58
n_length = 39
n_unique = 19
Embedded Image Embedded Image
40 2018-06-30 08:00:28 2018-07-13 12:00:33 63 1.05 mean = 7.16
sd = 3.68
n_length = 63
n_unique = 16
Embedded Image Embedded Image mean = 1.57
sd = 1.6
n_length = 63
n_unique = 8
Embedded Image Embedded Image
41 2018-06-02 10:00:09 2018-06-15 12:00:16 47 0.78 mean = 24.55
sd = 6.98
n_length = 47
n_unique = 22
Embedded Image Embedded Image mean = 14.6
sd = 3.67
n_length = 47
n_unique = 16
Embedded Image Embedded Image
42 2018-06-02 09:00:41 2018-06-15 12:00:41 41 0.68 mean = 33.8
sd = 4.39
n_length = 41
n_unique = 15
Embedded Image Embedded Image mean = 4.56
sd = 4.51
n_length = 41
n_unique = 13
Embedded Image Embedded Image
43 2018-09-05 08:00:32 2018-09-18 12:00:34 43 0.72 mean = 1.72
sd = 1.16
n_length = 43
n_unique = 6
Embedded Image Embedded Image mean = 1.26
sd = 0.76
n_length = 43
n_unique = 5
Embedded Image Embedded Image
44 2018-09-05 09:00:01 2018-09-18 12:00:43 46 0.77 mean = 23.78
sd = 3.23
n_length = 46
n_unique = 15
Embedded Image Embedded Image mean = 30.07
sd = 4.86
n_length = 46
n_unique = 19
Embedded Image Embedded Image
45 2018-02-10 09:00:31 2018-02-23 13:00:47 53 0.88 mean = 20.85
sd = 1.66
n_length = 53
n_unique = 8
Embedded Image Embedded Image mean = 4.13
sd = 1.97
n_length = 53
n_unique = 10
Embedded Image Embedded Image
46 2018-02-10 09:00:22 2018-02-23 13:00:41 59 0.98 mean = 2.02
sd = 1.57
n_length = 59
n_unique = 8
Embedded Image Embedded Image mean = 28.29
sd = 4.43
n_length = 59
n_unique = 21
Embedded Image Embedded Image
47 2018-10-01 11:00:22 2018-10-14 12:00:57 52 0.87 mean = 4.38
sd = 4.93
n_length = 52
n_unique = 14
Embedded Image Embedded Image mean = 1
sd = 0
n_length = 52
n_unique = 2
Embedded Image Embedded Image
48 2018-10-01 09:00:37 2018-10-14 12:00:09 53 0.88 mean = 14.55
sd = 3.48
n_length = 53
n_unique = 17
Embedded Image Embedded Image mean = 14.25
sd = 4.96
n_length = 53
n_unique = 19
Embedded Image Embedded Image
49 2018-07-09 08:00:34 2018-07-22 11:00:15 38 0.63 mean = 9.08
sd = 6.48
n_length = 38
n_unique = 21
Embedded Image Embedded Image mean = 7.18
sd = 4.38
n_length = 38
n_unique = 15
Embedded Image Embedded Image
50 2018-07-09 10:00:38 2018-07-22 12:00:38 50 0.83 mean = 19.38
sd = 3.63
n_length = 50
n_unique = 17
Embedded Image Embedded Image mean = 1.16
sd = 0.55
n_length = 50
n_unique = 5
Embedded Image Embedded Image
51 2018-10-08 11:00:40 2018-10-21 12:00:12 29 0.48 mean = 39.1
sd = 8.27
n_length = 29
n_unique = 22
Embedded Image Embedded Image mean = 87.28
sd = 9.69
n_length = 29
n_unique = 18
Embedded Image Embedded Image
52 2018-10-08 12:00:47 2018-10-21 10:00:52 38 0.63 mean = 1.08
sd = 0.36
n_length = 38
n_unique = 4
Embedded Image Embedded Image mean = 33.95
sd = 9.39
n_length = 38
n_unique = 26
Embedded Image Embedded Image
53 2018-09-18 08:00:30 2018-10-01 09:00:39 35 0.58 mean = 88.66
sd = 19.96
n_length = 35
n_unique = 14
Embedded Image Embedded Image mean = 85.11
sd = 29.9
n_length = 35
n_unique = 10
Embedded Image Embedded Image
54 2018-09-18 09:00:13 2018-10-01 12:00:26 55 0.92 mean = 36.27
sd = 45.91
n_length = 55
n_unique = 10
Embedded Image Embedded Image mean = 49.82
sd = 44.5
n_length = 55
n_unique = 18
Embedded Image Embedded Image
55 2018-10-27 10:00:44 2018-11-09 13:00:44 63 1.05 mean = 23.73
sd = 5.14
n_length = 63
n_unique = 21
Embedded Image Embedded Image mean = 1.03
sd = 0.25
n_length = 63
n_unique = 3
Embedded Image Embedded Image
56 2018-10-27 08:00:25 2018-11-09 13:00:37 65 1.08 mean = 29.17
sd = 4.55
n_length = 65
n_unique = 20
Embedded Image Embedded Image mean = 1.35
sd = 1.12
n_length = 65
n_unique = 7
Embedded Image Embedded Image
57 2018-09-08 10:00:03 2018-09-21 12:00:38 44 0.73 mean = 17.5
sd = 5.03
n_length = 44
n_unique = 18
Embedded Image Embedded Image mean = 4.61
sd = 2.01
n_length = 44
n_unique = 9
Embedded Image Embedded Image
58 2018-09-08 10:00:25 2018-09-21 12:00:25 49 0.82 mean = 16.55
sd = 5.61
n_length = 49
n_unique = 22
Embedded Image Embedded Image mean = 1.1
sd = 0.51
n_length = 49
n_unique = 4
Embedded Image Embedded Image
59 2018-10-09 08:00:31 2018-10-20 10:00:28 30 0.50 mean = 26.3
sd = 3.89
n_length = 30
n_unique = 14
Embedded Image Embedded Image mean = 3.77
sd = 1.77
n_length = 30
n_unique = 8
Embedded Image Embedded Image
60 2018-10-08 08:00:03 2018-10-21 10:59:59 56 0.93 mean = 13.77
sd = 2.78
n_length = 56
n_unique = 14
Embedded Image Embedded Image mean = 12.27
sd = 4.18
n_length = 56
n_unique = 19
Embedded Image Embedded Image