-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample_characterisation.Rmd
101 lines (78 loc) · 3.1 KB
/
sample_characterisation.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
---
output:
html_document:
theme: spacelab
---
# Sample characterisation (age)
```{r, message = FALSE}
library("tidyverse")
library("rstatix")
library("ini")
```
Load the data from the big behavioural table:
```{r}
config <- read.ini("../config.ini")
tbl_path <- file.path(config$DEFAULT$QUESTIONNAIRE_DIR, "table.tsv")
df <- read_tsv(tbl_path, col_types = cols()) %>%
select(c(subject_id:demonstrator_id, CONT_contingency, MFQ_ra, friendship_length))
```
Exclusions for technical reasons (3 subjects) and due to high number of motion outlier volumes (1 subject), all in the stranger group:
```{r}
df <- df %>%
filter(! label %in% c("Trltdn", "Cgotop", "Plarre", "Nagery"))
```
As a sanity check, get the number of participants after those exclusions (note that the number of demonstrators has to be equal to the number of friend observers):
```{r}
df %>%
count(role, group)
```
We are, however, interested only in the contingency-aware participants from now on (i.e. subjects for whom fMRI data is presented, not all who were recruited).
Age of the observers, regardless of group (note: age is the only numerical variable in `df` so no need to be explicit):
```{r}
df %>%
filter(role == "OBS" & CONT_contingency == "YES") %>%
get_summary_stats(age, show = c("mean", "sd", "median", "iqr", "min", "max"))
```
Age of the observers, broken down by group:
```{r}
df %>%
filter(role == "OBS" & CONT_contingency == "YES") %>%
group_by(group) %>%
get_summary_stats(age, show = c("mean", "sd", "median", "iqr", "min", "max"))
```
For the demonstrators, drop those for whom neither friend nor stranger learned the contingency, and calculate the age statistics:
```{r}
dem_subset <- df %>%
filter(role == "OBS" & CONT_contingency == "YES") %>%
pull(demonstrator_id) %>%
unique()
df %>%
filter(role == "DEM" & subject_id %in% dem_subset) %>%
get_summary_stats(age, show = c("mean", "sd", "median", "iqr", "min", "max"))
```
Length of the demonstrator-observer friendship (data collected only in the friend group. Both demonstrator and observer answered this question but we will stick to the observers' responses only):
* n=34 because subject Framwy did not respond
```{r}
df %>%
filter(role == "OBS" & CONT_contingency == "YES" & group == "friend") %>%
get_summary_stats(friendship_length, show = c("mean", "sd", "median", "iqr", "min", "max"))
```
McGill Friendship Questionnaire score (Friend group only, observers):
* n=34 because subject Framwy did not respond
```{r}
df %>%
filter(role == "OBS" & CONT_contingency == "YES" & group == "friend") %>%
get_summary_stats(MFQ_ra, show = c("mean", "sd", "median", "iqr", "min", "max"))
```
McGill Friendship Questionnaire score (Friend group only, demonstrators for whom observers learned contingency):
* n=34 because subject Framwy did not respond
```{r}
df_dem <- df
dem_subset <- df %>%
filter(role == "OBS" & CONT_contingency == "YES", group == "friend") %>%
pull(demonstrator_id) %>%
unique()
df_dem %>%
filter(role == "DEM" & subject_id %in% dem_subset) %>%
get_summary_stats(MFQ_ra, show = c("mean", "sd", "median", "iqr", "min", "max"))
```