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.
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 |
mean = 31.76 sd = 26.03 n_length = 41 n_unique = 24 |
||||
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 |
mean = 20.61 sd = 13.86 n_length = 54 n_unique = 34 |
||||
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 |
mean = 96.69 sd = 5.77 n_length = 36 n_unique = 11 |
||||
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 |
mean = 8.13 sd = 5.64 n_length = 52 n_unique = 19 |
||||
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 |
mean = 45.84 sd = 36.52 n_length = 31 n_unique = 23 |
||||
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 |
mean = 14.21 sd = 18.42 n_length = 38 n_unique = 18 |
||||
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 |
mean = 43.15 sd = 4.56 n_length = 47 n_unique = 18 |
||||
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 |
mean = 51.14 sd = 5.06 n_length = 51 n_unique = 20 |
||||
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 |
mean = 25.17 sd = 10.43 n_length = 24 n_unique = 19 |
||||
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 |
mean = 6.82 sd = 5.1 n_length = 39 n_unique = 17 |
||||
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 |
mean = 15.56 sd = 7.25 n_length = 57 n_unique = 26 |
||||
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 |
mean = 2.12 sd = 2.12 n_length = 60 n_unique = 10 |
||||
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 |
mean = 10.18 sd = 6.89 n_length = 55 n_unique = 24 |
||||
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 |
mean = 32.92 sd = 8.16 n_length = 62 n_unique = 27 |
||||
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 |
mean = 62.09 sd = 2.27 n_length = 56 n_unique = 12 |
||||
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 |
mean = 42.61 sd = 3.03 n_length = 57 n_unique = 16 |
||||
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 |
mean = 14.88 sd = 25.09 n_length = 34 n_unique = 12 |
||||
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 |
mean = 32.33 sd = 39.61 n_length = 57 n_unique = 20 |
||||
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 |
mean = 12.46 sd = 1.67 n_length = 54 n_unique = 9 |
||||
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 |
mean = 10.41 sd = 4.28 n_length = 66 n_unique = 18 |
||||
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 |
mean = 22.84 sd = 1.46 n_length = 32 n_unique = 8 |
||||
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 |
mean = 21.88 sd = 3 n_length = 41 n_unique = 15 |
||||
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 |
mean = 1 sd = 0 n_length = 45 n_unique = 2 |
||||
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 |
mean = 11.72 sd = 11.72 n_length = 50 n_unique = 22 |
||||
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 |
mean = 58.37 sd = 43.73 n_length = 38 n_unique = 16 |
||||
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 |
mean = 17.54 sd = 18.97 n_length = 69 n_unique = 33 |
||||
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 |
mean = 49.75 sd = 10.02 n_length = 51 n_unique = 32 |
||||
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 |
mean = 6.65 sd = 3.53 n_length = 57 n_unique = 15 |
||||
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 |
mean = 15.57 sd = 2.91 n_length = 40 n_unique = 11 |
||||
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 |
mean = 1.06 sd = 0.3 n_length = 67 n_unique = 4 |
||||
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 |
mean = 3.61 sd = 4.16 n_length = 56 n_unique = 14 |
||||
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 |
mean = 1.09 sd = 0.48 n_length = 56 n_unique = 4 |
||||
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 |
mean = 16.63 sd = 8.5 n_length = 54 n_unique = 27 |
||||
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 |
mean = 16.91 sd = 4.95 n_length = 58 n_unique = 21 |
||||
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 |
mean = 56.21 sd = 5.04 n_length = 53 n_unique = 19 |
||||
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 |
mean = 2.24 sd = 1.74 n_length = 63 n_unique = 8 |
||||
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 |
mean = 5.33 sd = 1.86 n_length = 45 n_unique = 10 |
||||
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 |
mean = 86.63 sd = 16.64 n_length = 52 n_unique = 28 |
||||
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 |
mean = 10.51 sd = 12.58 n_length = 39 n_unique = 19 |
||||
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 |
mean = 1.57 sd = 1.6 n_length = 63 n_unique = 8 |
||||
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 |
mean = 14.6 sd = 3.67 n_length = 47 n_unique = 16 |
||||
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 |
mean = 4.56 sd = 4.51 n_length = 41 n_unique = 13 |
||||
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 |
mean = 1.26 sd = 0.76 n_length = 43 n_unique = 5 |
||||
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 |
mean = 30.07 sd = 4.86 n_length = 46 n_unique = 19 |
||||
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 |
mean = 4.13 sd = 1.97 n_length = 53 n_unique = 10 |
||||
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 |
mean = 28.29 sd = 4.43 n_length = 59 n_unique = 21 |
||||
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 |
mean = 1 sd = 0 n_length = 52 n_unique = 2 |
||||
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 |
mean = 14.25 sd = 4.96 n_length = 53 n_unique = 19 |
||||
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 |
mean = 7.18 sd = 4.38 n_length = 38 n_unique = 15 |
||||
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 |
mean = 1.16 sd = 0.55 n_length = 50 n_unique = 5 |
||||
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 |
mean = 87.28 sd = 9.69 n_length = 29 n_unique = 18 |
||||
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 |
mean = 33.95 sd = 9.39 n_length = 38 n_unique = 26 |
||||
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 |
mean = 85.11 sd = 29.9 n_length = 35 n_unique = 10 |
||||
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 |
mean = 49.82 sd = 44.5 n_length = 55 n_unique = 18 |
||||
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 |
mean = 1.03 sd = 0.25 n_length = 63 n_unique = 3 |
||||
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 |
mean = 1.35 sd = 1.12 n_length = 65 n_unique = 7 |
||||
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 |
mean = 4.61 sd = 2.01 n_length = 44 n_unique = 9 |
||||
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 |
mean = 1.1 sd = 0.51 n_length = 49 n_unique = 4 |
||||
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 |
mean = 3.77 sd = 1.77 n_length = 30 n_unique = 8 |
||||
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 |
mean = 12.27 sd = 4.18 n_length = 56 n_unique = 19 |