grudata <- grudata %>%
slice(-1, -2) %>% #remove first and second row (irrelevant column titles)
dplyr::filter(Status==0) %>% #remove survey previews
dplyr::filter(Finished==1) %>% #remove unfinished responses
retype() #guesses the right data type then auto-converts
colnames(grudata)
## [1] "StartDate" "EndDate"
## [3] "Status" "IPAddress"
## [5] "Progress" "Duration (in seconds)"
## [7] "Finished" "RecordedDate"
## [9] "ResponseId" "RecipientLastName"
## [11] "RecipientFirstName" "RecipientEmail"
## [13] "ExternalReference" "LocationLatitude"
## [15] "LocationLongitude" "DistributionChannel"
## [17] "UserLanguage" "desc_wrds_1"
## [19] "desc_wrds_2" "desc_wrds_3"
## [21] "desc_wrds_4" "desc_wrds_5"
## [23] "desc_app" "desc_inapp"
## [25] "desc_rsn" "desc_emtn_1"
## [27] "desc_emtn_2" "desc_emtn_3"
## [29] "desc_emtn_4" "desc_emtn_5"
## [31] "desc_crmst" "stat-tar.US_1"
## [33] "stat-tar.US_2" "stat-tar.US_3"
## [35] "stat-tar.US_4" "stat-tar.US_5"
## [37] "stat-tar.US_6" "stat-tar.US_7"
## [39] "stat-tar.US_8" "stat-tar.US_9"
## [41] "stat-tar.US_10" "stat-tar.comm_1"
## [43] "stat-tar.comm_2" "stat-tar.comm_3"
## [45] "stat-tar.comm_4" "stat-tar.comm_5"
## [47] "stat-tar.comm_6" "stat-tar.comm_7"
## [49] "stat-tar.comm_8" "stat-tar.comm_9"
## [51] "stat-tar.comm_10" "stat-self.US_1"
## [53] "stat-self.US_2" "stat-self.US_3"
## [55] "stat-self.US_4" "stat-self.US_5"
## [57] "stat-self.US_6" "stat-self.US_7"
## [59] "stat-self.US_8" "stat-self.US_9"
## [61] "stat-self.US_10" "stat-self.comm_1"
## [63] "stat-self.comm_2" "stat-self.comm_3"
## [65] "stat-self.comm_4" "stat-self.comm_5"
## [67] "stat-self.comm_6" "stat-self.comm_7"
## [69] "stat-self.comm_8" "stat-self.comm_9"
## [71] "stat-self.comm_10" "honor_respect"
## [73] "honor_disres" "honor_socialimage"
## [75] "honor_careimplicatio" "honor_defendfam"
## [77] "demog_yr" "demog_edu"
## [79] "demog_hisp" "demog_Hisp2"
## [81] "demog_race_1" "demog_race_2"
## [83] "demog_race_3" "demog_race_4"
## [85] "demog_race_5" "demog_race_6"
## [87] "demog_race_6_TEXT" "demog_sex"
## [89] "demog_incme" "demog_state"
## [91] "demog_state_long" "demog_orien"
## [93] "demog_marital" "demog_living"
## [95] "demog_usaf" "demog_serv"
## [97] "demog_when_serve" "demog_pol_vot"
## [99] "demog_pol_presid" "demog_pol_party"
## [101] "demog_pol_party_4_TEXT" "demog_pol_strong_rep"
## [103] "demog_pol_strong_dem" "demog_pol_party_clos"
## [105] "demog_pol_scale_1" "demog_party_reg"
## [107] "demog_party_reg_4_TEXT" "demog_employ_stat"
## [109] "demog_employ_stat_7_TEXT" "demog_employee_no"
## [111] "demog_where_emp" "demog_industry"
## [113] "demog_occ" "feedback"
df.honor <- grudata %>%
dplyr::select(ResponseId, starts_with("honor")) %>%
rowwise() %>%
dplyr::mutate(honor_composite = round(mean(c(honor_respect, honor_disres, honor_socialimage,
honor_careimplicatio, honor_defendfam, na.rm = T)), 2)) %>% #avg 5 scales
dplyr::select(ResponseId, honor_composite)
df.honor %>%
print(10) #see first 10 rows
## # A tibble: 405 x 2
## # Rowwise:
## ResponseId honor_composite
## <chr> <dbl>
## 1 R_3CDWi1kNJKXJiLV NA
## 2 R_10OeUAY8BxR4N9H NA
## 3 R_3lDODAUiAQTzqvi 3.17
## 4 R_3Hhq5FAhV1IB8GL 4
## 5 R_1F4GgSqFlBGiCkI NA
## 6 R_RfYUkPPby1QuujL 3.33
## 7 R_1igmYlmlfpDF2EL 3.17
## 8 R_22PSaYuqrk3SnUn 3.17
## 9 R_2dm9vzigtyp6Ah8 2.5
## 10 R_1jCxORe1IGfwFBz NA
## # … with 395 more rows
grudata %>%
dplyr::select(ResponseId, starts_with("stat-tar.US")) %>%
print(10)
## # A tibble: 405 x 11
## ResponseId `stat-tar.US_1` `stat-tar.US_2` `stat-tar.US_3` `stat-tar.US_4`
## <chr> <chr> <chr> <chr> <chr>
## 1 R_3CDWi1k… <NA> <NA> <NA> <NA>
## 2 R_10OeUAY… <NA> <NA> <NA> <NA>
## 3 R_3lDODAU… Off Off Off Off
## 4 R_3Hhq5FA… Off Off Off Off
## 5 R_1F4GgSq… Off Off Off Off
## 6 R_RfYUkPP… Off Off Off Off
## 7 R_1igmYlm… Off Off Off Off
## 8 R_22PSaYu… Off Off Off Off
## 9 R_2dm9vzi… Off Off Off On
## 10 R_1jCxORe… Off Off Off Off
## # … with 395 more rows, and 6 more variables: `stat-tar.US_5` <chr>,
## # `stat-tar.US_6` <chr>, `stat-tar.US_7` <chr>, `stat-tar.US_8` <chr>,
## # `stat-tar.US_9` <chr>, `stat-tar.US_10` <chr>
df.status <- grudata %>%
dplyr::select(ResponseId, starts_with("stat")) %>% #select status rating columns
drop_na() %>%
pivot_longer(cols = -ResponseId,
names_to = c("status2", "rating"),
names_sep = "_",
values_to = "values",
values_transform = list(values = as.character)) %>% #make long
convert(num(rating)) %>%
filter(values == "On") %>%
separate(status2, c("variable", "evaluated"), "-") %>%
select(-variable, -values) %>% #deselect variable (list of 'stat') and values (list of 'On')
drop_na(rating) %>%
pivot_wider(names_from = "evaluated",
values_from = "rating")
## Warning: Expected 2 pieces. Missing pieces filled with `NA` in 1 rows [1].
df.status %>%
print(10)
## # A tibble: 402 x 5
## ResponseId tar.US tar.comm self.US self.comm
## <chr> <dbl> <dbl> <dbl> <dbl>
## 1 R_3lDODAUiAQTzqvi 5 5 4 5
## 2 R_3Hhq5FAhV1IB8GL 7 4 NA 6
## 3 R_1F4GgSqFlBGiCkI 6 6 3 4
## 4 R_RfYUkPPby1QuujL 6 5 5 5
## 5 R_1igmYlmlfpDF2EL 7 5 4 4
## 6 R_22PSaYuqrk3SnUn 7 5 6 5
## 7 R_2dm9vzigtyp6Ah8 4 2 6 4
## 8 R_1jCxORe1IGfwFBz 5 8 6 8
## 9 R_3nvg2R1ZgwcZIvF NA 4 5 5
## 10 R_2flflB6ll7Ap7JU 4 5 5 5
## # … with 392 more rows
# Show table with group means
df.status %>%
pivot_longer(cols = -ResponseId,
names_to = "evaluatee",
values_to = "ratings") %>%
group_by(evaluatee) %>%
dplyr::summarize(mean_rating = mean(ratings, na.rm = T))
## # A tibble: 4 x 2
## evaluatee mean_rating
## * <chr> <dbl>
## 1 self.comm 5.60
## 2 self.US 5.69
## 3 tar.comm 5.60
## 4 tar.US 5.78
#Visualize group means
df.status %>%
pivot_longer(cols = -ResponseId,
names_to = "evaluatee",
values_to = "ratings") %>%
dplyr::mutate(across(.cols = "evaluatee",
.fns = ~as.factor(.))) %>%
dplyr::mutate(Evaluatee = fct_relevel(evaluatee, "self.US", "tar.US", "self.comm", "tar.comm")) %>%
select(-evaluatee) %>%
relocate(ratings, .after = Evaluatee) %>%
separate("Evaluatee", c("object", "region")) %>% #separate columns for easier plotting
ggplot(aes(x = object,
y = ratings)) +
stat_summary(fun.y = "mean",
geom = "point") +
# stat_summary(fun.data = "mean_cl_boot",
# geom = "linerange") +
facet_wrap(~region) +#NB: after adding C.Intervals, there doesn't seem to be any group differences +
labs(title = "Status ratings of self and target in the US and community")
## Warning: `fun.y` is deprecated. Use `fun` instead.
## Warning: Removed 27 rows containing non-finite values (stat_summary).
Results: Not hypothesis-tested yet, but the trend appears to be that individuals with higher honor scores held grudges on targets of a higher status than them, whereas individuals with lower honor scores held grudges on targets of a lower status than themself
df.honstat <- df.status %>% #combine status and honor values
left_join(df.honor %>%
select(ResponseId, honor_composite),
by = "ResponseId") %>%
drop_na()
#maybe plot honor against difference between target and self evaluations. Get mean target and mean Self
df.honstat %>%
rowwise() %>%
dplyr::mutate(tar.mean = mean(c(tar.US, tar.comm)),
self.mean = mean(c(self.US, self.comm)),
diff = tar.mean - self.mean) %>%
ggplot(aes(x = honor_composite,
y = diff)) +
geom_point() +
geom_smooth(method = "lm", se = T) +
geom_hline(yintercept = 0,
linetype = 2,
color = "dark grey") +
labs(y = "Target - Self status rating",
x = "Honor values score")
## `geom_smooth()` using formula 'y ~ x'
LIWC software appears to have 2 uses:
- Analyze text: Measures % of words in a category/ dimension. I ran this analysis on LIWC but I didn’t show it here because it didn’t seem all that useful but we can definitely revisit. - Categorize text: indicate which categories words belong to based on pre-defined categories. No ways to custom-make your own categories. This is the technique I used below. The word categories on LIWC are many and quite varied in their meaning. I just selected a subset here, and these can be subsetted further. Will explain more when we meet
List some (5) words that come to mind when you think of holding a grudge
# 1 ==================
df.desc_1 <- grudata %>%
select(starts_with("desc_wrds_1")) #first select columns
# write_csv(df.desc_1, "desc_1.csv") #then write to csv
# >Then open and convert to txt > Then categorize on LIWC
# > Then save LIWC txt output as csv > Then Read the saved csv back to R
# 2 ==================
df.desc_2 <- grudata %>%
select(starts_with("desc_wrds_2")) #first select columns
# write_csv(df.desc_2, "desc_2.csv") #then write to csv
# 3 ==================
df.desc_3 <- grudata %>%
select(starts_with("desc_wrds_3")) #first select columns
# write_csv(df.desc_3, "desc_3.csv") #then write to csv
# 4 ==================
df.desc_4 <- grudata %>%
select(starts_with("desc_wrds_4")) #first select columns
# write_csv(df.desc_4, "desc_4.csv") #then write to csv
# 5 ==================
df.desc_5 <- grudata %>%
select(starts_with("desc_wrds_5")) #first select columns
# write_csv(df.desc_5, "desc_5.csv") #then write to csv
## ================================================================== ##
df.desc1_cat <- df.desc1_cat %>%
slice(-1, -2, -3) %>%
pivot_longer(cols = -Word,
names_to = "LIWC_categories",
values_to = "check") %>%
drop_na() %>%
group_by(LIWC_categories) %>% #at this point we're more interested in categories than the words
dplyr::summarize(n_1 = n())
df.desc2_cat <- df.desc2_cat %>%
slice(-1, -2, -3) %>%
pivot_longer(cols = -Word,
names_to = "LIWC_categories",
values_to = "check") %>%
drop_na() %>%
group_by(LIWC_categories) %>% #at this point we're more interested in categories than the words
dplyr::summarize(n_2 = n())
df.desc3_cat <- df.desc3_cat %>%
slice(-1, -2, -3) %>%
pivot_longer(cols = -Word,
names_to = "LIWC_categories",
values_to = "check") %>%
drop_na() %>%
group_by(LIWC_categories) %>% #at this point we're more interested in categories than the words
dplyr::summarize(n_3 = n())
df.desc4_cat <- df.desc4_cat %>%
slice(-1, -2, -3) %>%
pivot_longer(cols = -Word,
names_to = "LIWC_categories",
values_to = "check") %>%
drop_na() %>%
group_by(LIWC_categories) %>% #at this point we're more interested in categories than the words
dplyr::summarize(n_4 = n())
df.desc5_cat <- df.desc5_cat %>%
slice(-1, -2, -3) %>%
pivot_longer(cols = -Word,
names_to = "LIWC_categories",
values_to = "check") %>%
drop_na() %>%
group_by(LIWC_categories) %>% #at this point we're more interested in categories than the words
dplyr::summarize(n_5 = n())
# Joining ========================== #
df.desc_all <- join_all(list(df.desc1_cat, df.desc2_cat, df.desc3_cat, df.desc4_cat, df.desc5_cat),
by='LIWC_categories',
type='left')
# Plotting ========================== #
df.desc_all %>%
#filter(categories %in% c("anger","adj")) %>% ## ACTIVATE this to subset specific categories
pivot_longer(cols = -LIWC_categories,
names_to = "position",
values_to = "mentions") %>%
ggplot(aes(x = position, y = mentions, group = LIWC_categories, color = LIWC_categories)) +
geom_point() +
# geom_smooth(method = "lm", se = F)
labs(x = "nth response",
y = "total mentions",
title = "Graph of total word mentions in selected LIWC categories")
## Warning: Removed 10 rows containing missing values (geom_point).
Describe a circumstance where you think its right to hold a grudge NB: didn’t analyze this yet. For our purposes, we want human coders to parse through this rather than LIWC (in my opinion). So I didn’t run any analysis on these. The next question I analyze is Q4
grudata %>%
select(starts_with("desc_app")) %>%
print(10)
## # A tibble: 405 x 1
## desc_app
## <chr>
## 1 friends insuls kid
## 2 <NA>
## 3 If someone has done something to significantly impact your life in a negativ…
## 4 Physical, emotional, mental abuse.
## 5 Someone has significantly wronged you or someone close to you.
## 6 A circumstance where it is okay to hold a grudge is one where the other part…
## 7 I don't know if I ever think it's *right* to hold a grudge. I don't think th…
## 8 When someone you thought cared about you and that you cared about, does some…
## 9 I think its right to hold a grudge if the other person is seriously harmful …
## 10 When someone has wronged you.
## # … with 395 more rows
Describe a circumstance where you think its wrong to hold a grudge
grudata %>%
select(starts_with("desc_inapp")) %>%
print(10)
## # A tibble: 405 x 1
## desc_inapp
## <chr>
## 1 friend accidentally hurts feelings
## 2 <NA>
## 3 You shouldn't hold a grudge over something petty, like not getting back $10 …
## 4 If someone acknowleges this mistakes and sincerely apologies
## 5 Someone has beaten you in fair competition, or due to chance.
## 6 A circumstance where it is wrong to hold a grudge is one where an act was un…
## 7 I think if you hold a grudge against someone for something they didn't do...…
## 8 If someone did something that hurt me but ultimately was for my best interes…
## 9 It would be wrong to hold a grudge if the person is genuinely remorseful and…
## 10 When someone has not wronged you.
## # … with 395 more rows
For what reason do people typically hold grudges?
grudata %>%
select(starts_with("desc_rsn")) %>%
print(10)
## # A tibble: 405 x 1
## desc_rsn
## <chr>
## 1 "insult"
## 2 <NA>
## 3 "They have emotional imbalances that they need to learn to control."
## 4 "they feel very hurt and are unable to let go of the pain in order to let go…
## 5 "They cannot - for whatever reason - express their anger immediately or let …
## 6 "People hold grudges because humans are sensitive and egos are easy to wound…
## 7 "Someone else hurt them."
## 8 "Because we can't let go of the pain we felt by someone's actions."
## 9 "I think people typically hold grudges after being betrayed, or experiencing…
## 10 "Because they are upset with something someone did."
## # … with 395 more rows
List some (5) emotions you think people feel when they hold a grudge
knitr::opts_knit$set(root.dir = normalizePath(".."))
grudata %>%
select(starts_with("desc_emtn")) %>%
print(10)
## # A tibble: 405 x 5
## desc_emtn_1 desc_emtn_2 desc_emtn_3 desc_emtn_4 desc_emtn_5
## <chr> <chr> <chr> <chr> <chr>
## 1 poopiness grumpiness ennui anger jealousy
## 2 <NA> <NA> <NA> <NA> <NA>
## 3 Anger Vindictitive Stressed Unhinged Aggressive
## 4 anger frustration disgust sadness hurt
## 5 anger hate insecurity bitterness resentment
## 6 Anger Sadness Rejected Heartbroken Unresolved
## 7 anger resentment having been wronged wanting to retaliate hurt
## 8 angry confused furious burdened vindictive
## 9 Anger Resentment Frustration Betrayal Hurt
## 10 Anger Frustration Sadness Meaness Loudness
## # … with 395 more rows
# 1 ==================
df.emtn_1 <- grudata %>%
select(starts_with("desc_emtn_1")) #first select columns
# write_csv(df.emtn_1, "emtn_1.csv") #then write to csv
# >Then open and convert to txt > Then categorize on LIWC
# > Then save LIWC txt output as csv > Then Read the saved csv back to R
# 2 ==================
df.emtn_2 <- grudata %>%
select(starts_with("desc_emtn_2")) #first select columns
# write_csv(df.emtn_2, "emtn_2.csv") #then write to csv
# 3 ==================
df.emtn_3 <- grudata %>%
select(starts_with("desc_emtn_3")) #first select columns
# write_csv(df.emtn_3, "emtn_3.csv") #then write to csv
# 4 ==================
df.emtn_4 <- grudata %>%
select(starts_with("desc_emtn_4")) #first select columns
# write_csv(df.emtn_4, "emtn_4.csv") #then write to csv
# 5 ==================
df.emtn_5 <- grudata %>%
select(starts_with("desc_emtn_5")) #first select columns
# write_csv(df.emtn_5, "emtn_5.csv") #then write to csv
## ================================================================== ##
df.emtn1_cat %>%
print(10) #LIWC output
## # A tibble: 79 x 28
## Word verb adj compare interrog number quant affect posemo negemo anx
## <chr> <chr> <chr> <lgl> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
## 1 desc <NA> <NA> NA <NA> <NA> <NA> <NA> <NA> <NA> <NA>
## 2 emtn <NA> <NA> NA <NA> <NA> <NA> <NA> <NA> <NA> <NA>
## 3 1 <NA> <NA> NA <NA> X <NA> <NA> <NA> <NA> <NA>
## 4 poop… <NA> <NA> NA <NA> <NA> <NA> <NA> <NA> <NA> <NA>
## 5 na <NA> <NA> NA <NA> <NA> <NA> <NA> <NA> <NA> <NA>
## 6 anger <NA> <NA> NA <NA> <NA> <NA> X <NA> X <NA>
## 7 angry <NA> X NA <NA> <NA> <NA> X <NA> X <NA>
## 8 hurt <NA> <NA> NA <NA> <NA> <NA> X <NA> X <NA>
## 9 depr… <NA> <NA> NA <NA> <NA> <NA> X <NA> X <NA>
## 10 bitt… <NA> X NA <NA> <NA> <NA> X <NA> X <NA>
## # … with 69 more rows, and 17 more variables: anger <chr>, sad <chr>,
## # social <chr>, cogproc <chr>, percept <chr>, see <lgl>, hear <lgl>,
## # feel <chr>, drives <chr>, power <chr>, reward <lgl>, risk <chr>,
## # focuspast <chr>, focuspresent <chr>, focusfuture <chr>, relativ <chr>,
## # informal <chr>
df.emtn1_cat <- df.emtn1_cat %>%
slice(-1, -2, -3) %>%
pivot_longer(cols = -Word,
names_to = "LIWC_categories",
values_to = "check") %>%
drop_na() %>%
group_by(LIWC_categories) %>% #at this point we're more interested in categories than the words
dplyr::summarize(n_1 = n())
df.emtn2_cat <- df.emtn2_cat %>%
slice(-1, -2, -3) %>%
pivot_longer(cols = -Word,
names_to = "LIWC_categories",
values_to = "check") %>%
drop_na() %>%
group_by(LIWC_categories) %>%
dplyr::summarize(n_2 = n())
df.emtn3_cat <- df.emtn3_cat %>%
slice(-1, -2, -3) %>%
pivot_longer(cols = -Word,
names_to = "LIWC_categories",
values_to = "check") %>%
drop_na() %>%
group_by(LIWC_categories) %>%
dplyr::summarize(n_3 = n())
df.emtn4_cat <- df.emtn4_cat %>%
slice(-1, -2, -3) %>%
pivot_longer(cols = -Word,
names_to = "LIWC_categories",
values_to = "check") %>%
drop_na() %>%
group_by(LIWC_categories) %>%
dplyr::summarize(n_4 = n())
df.emtn5_cat <- df.emtn5_cat %>%
slice(-1, -2, -3) %>%
pivot_longer(cols = -Word,
names_to = "LIWC_categories",
values_to = "check") %>%
drop_na() %>%
group_by(LIWC_categories) %>%
dplyr::summarize(n_5 = n())
# Joining ========================== #
df.emtn_all <- join_all(list(df.emtn1_cat, df.emtn2_cat, df.emtn3_cat, df.emtn4_cat, df.emtn5_cat),
by='LIWC_categories',
type='left')
df.emtn_all %>%
#filter(categories %in% c("anger","adj")) %>% ## ACTIVATE this to subset specific categories
pivot_longer(cols = -LIWC_categories,
names_to = "position",
values_to = "mentions") %>%
ggplot(aes(x = position, y = mentions, group = LIWC_categories, color = LIWC_categories)) +
geom_point() +
# geom_smooth(method = "lm", se = F)
labs(x = "nth response",
y = "total mentions",
title = "Graph of total EMOTION word mentions in selected LIWC categories")
## Warning: Removed 5 rows containing missing values (geom_point).
Describe a circumstance where you have held a grudge (sentences)
grudata %>%
select(starts_with("desc_crmst")) %>%
print(10)
## # A tibble: 405 x 1
## desc_crmst
## <chr>
## 1 my sisrer was mean
## 2 <NA>
## 3 A coworker would consistently annoy me and would often do what he could to t…
## 4 <NA>
## 5 Love triangle
## 6 I held a grudge when my sister didn't take part in my family's Christmas whi…
## 7 Definitely held a grudge against a woman I worked with in high school -- a 5…
## 8 I held a grudge against a classmate for getting me in trouble despite it bei…
## 9 I held a grudge against someone who bullied me while growing up, especially …
## 10 When someone took the last piece of pizza.
## # … with 395 more rows