-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrait_correlations.R
85 lines (50 loc) · 2.21 KB
/
trait_correlations.R
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
library(tidyverse)
library(haven)
library(knitr)
library(kableExtra)
setwd()
# Data--------------------------------------------------------------------------
data <- read_dta('PersonalityAndPG_Clean.dta')
# Personality traits for subjects in all conditions
personality_data <- data %>%
select(SubjectID, condition, session, Period, 'Honesty-Humility' = honesty,
'Emotionality' = emotion,
'Extraversion' = extraver,
'Agreeableness' = agreeable,
'Conscientiousness' = conscient,
'Openness to Experience' = openness) %>%
distinct(SubjectID, .keep_all = TRUE)
# Contribution Info personality traits
cond1 <- personality_data %>%
filter(condition == 1)
# Personality Info personality traits
cond2 <- personality_data %>%
filter(condition == 2)
# Personality & Contribution Info personality traits
cond3 <- personality_data %>%
filter(condition == 3)
# Correlation Tables------------------------------------------------------------
# All conditions
# TABLE E1: Spearman Rank Correlations for Personality Traits Across All Conditions
corr_table <- cor(personality_data[, 5:10], method = 'spearman') %>%
round(., 2)
kable(corr_table, "latex", booktabs = T) %>%
kable_styling(latex_options = c("scale_down"))
# Contribution Info
# TABLE E2: Spearman Rank Correlations for Personality Traits in Contribution Info
corr_table_base <- cor(cond1[, 5:10], method = 'spearman') %>%
round(., 2)
kable(corr_table_base, "latex", booktabs = T) %>%
kable_styling(latex_options = c("scale_down"))
# Personality Info
# TABLE E3: Spearman Rank Correlations for Personality Traits in Personality Info
corr_table_pers <- cor(cond2[, 5:10], method = 'spearman') %>%
round(., 2)
kable(corr_table_pers, "latex", booktabs = T) %>%
kable_styling(latex_options = c("scale_down"))
# Personality & Contribution Info
# TABLE E4: Spearman Rank Correlations for Personality Traits in Personality & Contribution Info
corr_table_pers_cont <- cor(cond3[, 5:10], method = 'spearman') %>%
round(., 2)
kable(corr_table_pers_cont, "latex", booktabs = T) %>%
kable_styling(latex_options = c("scale_down"))