Group = 0 participants first responded to the
LIKING items, then the emissions ranking task, then the
FAMILIARITY items.
Group = 1
participants first responded to the FAMILIARITY items,
then the emissions ranking task, then the LIKING
items.
knitr::opts_chunk$set(echo = TRUE)
library(dplyr)
library(tidyverse)
library(ggplot2)
library(knitr)
library(ggsignif)
library(kableExtra)
library(stargazer)
library(ggpubr)
library(sjPlot)
library(broom)
setwd("/Users/ers2257/Library/CloudStorage/Dropbox/8. Dissertation/1. Order Manipulation")
df <- read.csv("Halo Attribute Manipulation_May 21, 2024_18.30.csv")
df <- df[c(44:443),-c(3, 8, 10:13, 16:17, 69, grep("(_First\\.Click$|_Last\\.Click$|_Click\\.Count$)", names(df)))] %>%
rename(T_Total = Duration..in.seconds.,
T_Liking = T_ABS_LIKING_Page.Submit,
T_Emissions = T_ABS_EMISSIONS_Page.Submit,
T_Familiarity = T_ABS_FAMILIARITY_Page.Submit,
Emissions_Nike = ABS_EMISSIONS_13,
Emissions_Coke = ABS_EMISSIONS_14,
Emissions_Wendys = ABS_EMISSIONS_15,
Emissions_Marriott = ABS_EMISSIONS_16,
Emissions_PG = ABS_EMISSIONS_17,
Emissions_United = ABS_EMISSIONS_18,
Emissions_ATT = ABS_EMISSIONS_19) %>%
mutate(across(starts_with(c("T_")), as.numeric))
df <- df %>%
separate(ABS_FAMILIARITY_DO, into = paste0("Item_", 1:7), sep = "\\|") %>%
pivot_longer(cols = starts_with("Item_"), names_to = "Item_Position", values_to = "Company") %>%
pivot_longer(cols = starts_with("ABS_FAMILIARITY_"), names_to = "Rating_Position", values_to = "Rating") %>%
mutate(Rating_Position = as.numeric(str_extract(Rating_Position, "\\d+")),
Item_Position = as.numeric(str_extract(Item_Position, "\\d+"))) %>%
filter(Rating_Position == Item_Position)
df <- df %>%
select(-Rating_Position, -Item_Position) %>%
pivot_wider(names_from = Company, values_from = Rating, names_prefix = "Fam_", names_sep = "_Familiarity") %>%
rename_with(~ gsub("\\.\\.", "_", .))
df <- df %>%
rename(Fam_Coke = "Fam_The Coca-Cola Company",
Fam_Wendys = "Fam_The Wendy's Company",
Fam_Nike = 'Fam_NIKE Inc.',
Fam_ATT = 'Fam_AT&T Inc.',
Fam_Marriott = 'Fam_Marriott International, Inc.',
Fam_PG = 'Fam_Procter & Gamble Company',
Fam_United = 'Fam_United Airlines Holdings')
df <- df %>%
separate(ABS_LIKING_DO, into = paste0("Item_", 1:7), sep = "\\|") %>%
pivot_longer(cols = starts_with("Item_"), names_to = "Item_Position", values_to = "Company") %>%
pivot_longer(cols = starts_with("ABS_LIKING_"), names_to = "Rating_Position", values_to = "Rating") %>%
mutate(Rating_Position = as.numeric(str_extract(Rating_Position, "\\d+")),
Item_Position = as.numeric(str_extract(Item_Position, "\\d+"))) %>%
filter(Rating_Position == Item_Position)
df <- df %>%
select(-Rating_Position, -Item_Position) %>%
pivot_wider(names_from = Company, values_from = Rating, names_prefix = "Like_", names_sep = "_Liking") %>%
rename_with(~ gsub("\\.\\.", "_", .))
df <- df %>%
rename(Like_Coke = "Like_The Coca-Cola Company",
Like_Wendys = "Like_The Wendy's Company",
Like_Nike = 'Like_NIKE Inc.',
Like_ATT = 'Like_AT&T Inc.',
Like_Marriott = 'Like_Marriott International, Inc.',
Like_PG = 'Like_Procter & Gamble Company',
Like_United = 'Like_United Airlines Holdings')
df_long <- df %>%
pivot_longer(cols = starts_with(c("Fam_", "Like_", "Emissions_")),
names_to = c(".value", "Company"),
names_pattern = "(.*)_(.*)")
df_long <- df_long %>%
mutate(Fam = case_when(
Fam == "1(Not At All Familiar)" ~ "1",
Fam == "7(Very Familiar)" ~ "7",
TRUE ~ Fam)) %>%
mutate(Like = case_when(
Like == "1(Dislike Very Much)" ~ "1",
Like == "7(Like Very Much)" ~ "7",
TRUE ~ Like)) %>%
mutate(POLITICAL = case_when(
POLITICAL == "1 (Extremely Liberal)" ~ "1",
POLITICAL == "7 (Extremely Conservative)" ~ "7",
TRUE ~ POLITICAL))
df_long <- df_long %>%
mutate(ObjRank = case_when(
Company == "United" ~ 1,
Company == "PG" ~ 2,
Company == "Marriott" ~ 3,
Company == "ATT" ~ 4,
Company == "Coke" ~ 5,
Company == "Nike" ~ 6,
Company == "Wendys" ~ 7))
df_long <- df_long %>%
mutate(across(c(Fam, Like, Emissions, POLITICAL), as.numeric))
df_long <- df_long %>%
group_by(ResponseId) %>%
mutate(Tau = cor(Emissions, ObjRank, method = "kendall")) %>%
ungroup()
df_n_length <- df_long %>%
select(-ABS_EMISSIONS_DO, -Company, -Fam, -Like, -Emissions, -ObjRank) %>%
distinct(ResponseId, .keep_all = TRUE)
df_like <- df_long %>%
select(ResponseId, Company, Like, Group)
like_means <- df_like %>%
group_by(Company) %>%
summarise(
mean_like = mean(Like, na.rm = TRUE),
mean_like_0 = mean(Like[Group == 0], na.rm = TRUE),
mean_like_1 = mean(Like[Group == 1], na.rm = TRUE))
df_fam <- df_long %>%
select(ResponseId, Company, Fam, Group)
fam_means <- df_fam %>%
group_by(Company) %>%
summarise(
mean_fam = mean(Fam, na.rm = TRUE),
mean_fam_0 = mean(Fam[Group == 0], na.rm = TRUE),
mean_fam_1 = mean(Fam[Group == 1], na.rm = TRUE))
The overall mean tau, across conditions, is 0.27
ggplot(df_n_length, aes(x = Tau)) +
geom_histogram(fill = "darkblue", binwidth = 0.03, aes(y = after_stat(count))) +
geom_density(aes(y = .15 * after_stat(count)), fill = "blue", alpha = .2) +
theme_minimal() +
labs(subtitle = "")
The overall mean tau for the Liking then Familiarity
Condition is 0.28
The overall mean tau
for the Familiarity then Liking Condition is
0.25
ggplot(df_n_length, aes(x = Tau)) +
geom_histogram(fill = "darkblue", binwidth = 0.03, aes(y = after_stat(count))) +
geom_density(aes(y = .15 * after_stat(count)), fill = "blue", alpha = .2) +
theme_minimal() +
facet_wrap(~ Group, scales = "free_x", ncol = 2) +
labs(title = "Tau Distributions per Condition")
ggplot(df_n_length, aes(x = factor(Group), y = Tau, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Tau Across Conditions", x = "Group", y = "Tau", fill = "Group") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
The overall mean liking value, across conditions, is 4.12
ggplot(df_like, aes(x = Like)) +
geom_histogram(binwidth = .5, fill = "darkblue", color = "blue") +
geom_density(aes(y = after_stat(count)), fill = "blue", alpha = .2) +
facet_wrap(~ Company) +
geom_text(data = like_means, aes(x = 2, y = 125, label = paste0("Mean = ", round(mean_like, 2))),
vjust = 1.5, hjust = 0.5, color = "blue", size = 4) +
labs(title = "Distribution of Liking for Each Company",
x = "Liking (1 = Dislike Very Much; 7 = Like Very Much)",
y = "Count") +
theme_minimal()
The overall mean liking value for the Liking then Familiarity
Condition is 4.15
The overall mean
liking value for the Familiarity then Liking Condition
is 4.09
ggplot(df_like, aes(x = Like)) +
geom_histogram(binwidth = 1, fill = "darkblue", color = "blue") +
facet_grid(Company ~ Group) +
geom_text(data = like_means, aes(x = 2, y = 125, label = paste0("Mean = ", round(mean_like, 2))),
vjust = 1.5, hjust = 0.5, color = "blue", size = 3) +
geom_text(data = like_means, aes(x = 2, y = 105, label = paste0("Mean (Group 0) = ", round(mean_like_0, 2))),
vjust = 1.5, hjust = 0.5, color = "darkblue", size = 3) +
geom_text(data = like_means, aes(x = 2, y = 85, label = paste0("Mean (Group 1) = ", round(mean_like_1, 2))),
vjust = 1.5, hjust = 0.5, color = "darkblue", size = 3) +
labs(title = "Distribution of Liking for Each Company, by Condition",
x = "Liking (1 = Dislike Very Much; 7 = Like Very Much)",
y = "Count") +
theme_minimal()
ggplot(df_like %>% filter(Company == "ATT"), aes(x = factor(Group), y = Like, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Liking for ATT", x = "Group", y = "Like Value", fill = "Group") +
geom_text(data = df_like %>% filter(Company == "ATT") %>% group_by(Group) %>% summarise(mean_like = mean(Like, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_like, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
ggplot(df_like %>% filter(Company == "Coke"), aes(x = factor(Group), y = Like, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Liking for Coke", x = "Group", y = "Like Value", fill = "Group") +
geom_text(data = df_like %>% filter(Company == "Coke") %>% group_by(Group) %>% summarise(mean_like = mean(Like, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_like, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
ggplot(df_like %>% filter(Company == "Marriott"), aes(x = factor(Group), y = Like, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Liking for Marriott", x = "Group", y = "Like Value", fill = "Group") +
geom_text(data = df_like %>% filter(Company == "Marriott") %>% group_by(Group) %>% summarise(mean_like = mean(Like, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_like, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
ggplot(df_like %>% filter(Company == "Nike"), aes(x = factor(Group), y = Like, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Liking for Nike", x = "Group", y = "Like Value", fill = "Group") +
geom_text(data = df_like %>% filter(Company == "Nike") %>% group_by(Group) %>% summarise(mean_like = mean(Like, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_like, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
ggplot(df_like %>% filter(Company == "PG"), aes(x = factor(Group), y = Like, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Liking for PG", x = "Group", y = "Like Value", fill = "Group") +
geom_text(data = df_like %>% filter(Company == "PG") %>% group_by(Group) %>% summarise(mean_like = mean(Like, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_like, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
ggplot(df_like %>% filter(Company == "United"), aes(x = factor(Group), y = Like, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Liking for United", x = "Group", y = "Like Value", fill = "Group") +
geom_text(data = df_like %>% filter(Company == "United") %>% group_by(Group) %>% summarise(mean_like = mean(Like, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_like, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
ggplot(df_like %>% filter(Company == "Wendys"), aes(x = factor(Group), y = Like, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Liking for Wendys", x = "Group", y = "Like Value", fill = "Group") +
geom_text(data = df_like %>% filter(Company == "Wendys") %>% group_by(Group) %>% summarise(mean_like = mean(Like, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_like, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
The overall mean familiarity value, across conditions, is 5.11
ggplot(df_fam, aes(x = Fam)) +
geom_histogram(binwidth = .5, fill = "darkblue", color = "blue") +
geom_density(aes(y = after_stat(count)), fill = "blue", alpha = .2) +
facet_wrap(~ Company) +
geom_text(data = fam_means, aes(x = 2, y = 100, label = paste0("Mean = ", round(mean_fam, 2))),
vjust = 1.5, hjust = 0.5, color = "blue", size = 4) +
labs(title = "Distribution of Familiarity for Each Company",
x = "Familiarity (1 = Not At All Familiar; 7 = Very Familiar)",
y = "Count") +
theme_minimal()
The overall mean familiarity value for the Liking then
Familiarity Condition is 5.07
The
overall mean familiarity value for the Familiarity then Liking
Condition is 5.15
ggplot(df_fam, aes(x = Fam)) +
geom_histogram(binwidth = 1, fill = "darkblue", color = "blue") +
facet_grid(Company ~ Group) +
geom_text(data = fam_means, aes(x = 2, y = 125, label = paste0("Mean = ", round(mean_fam, 2))),
vjust = 1.5, hjust = 0.5, color = "blue", size = 3) +
geom_text(data = fam_means, aes(x = 2, y = 105, label = paste0("Mean (Group 0) = ", round(mean_fam_0, 2))),
vjust = 1.5, hjust = 0.5, color = "darkblue", size = 3) +
geom_text(data = fam_means, aes(x = 2, y = 85, label = paste0("Mean (Group 1) = ", round(mean_fam_1, 2))),
vjust = 1.5, hjust = 0.5, color = "darkblue", size = 3) +
labs(title = "Distribution of Familiarity for Each Company, by Condition",
x = "Familiarity (1 = Not At All Familiar; 7 = Very Familiar)",
y = "Count") +
theme_minimal()
ggplot(df_fam %>% filter(Company == "ATT"), aes(x = factor(Group), y = Fam, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Familiarity for ATT", x = "Group", y = "Familiarity Value", fill = "Group") +
geom_text(data = df_fam %>% filter(Company == "ATT") %>% group_by(Group) %>% summarise(mean_fam = mean(Fam, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_fam, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
ggplot(df_fam %>% filter(Company == "Coke"), aes(x = factor(Group), y = Fam, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Familiarity for Coke", x = "Group", y = "Familiarity Value", fill = "Group") +
geom_text(data = df_fam %>% filter(Company == "Coke") %>% group_by(Group) %>% summarise(mean_fam = mean(Fam, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_fam, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
ggplot(df_fam %>% filter(Company == "Marriott"), aes(x = factor(Group), y = Fam, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Familiarity for Marriott", x = "Group", y = "Familiarity Value", fill = "Group") +
geom_text(data = df_fam %>% filter(Company == "Marriott") %>% group_by(Group) %>% summarise(mean_fam = mean(Fam, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_fam, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
ggplot(df_fam %>% filter(Company == "Nike"), aes(x = factor(Group), y = Fam, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Familiarity for Nike", x = "Group", y = "Familiarity Value", fill = "Group") +
geom_text(data = df_fam %>% filter(Company == "Nike") %>% group_by(Group) %>% summarise(mean_fam = mean(Fam, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_fam, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
ggplot(df_fam %>% filter(Company == "PG"), aes(x = factor(Group), y = Fam, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Familiarity for PG", x = "Group", y = "Familiarity Value", fill = "Group") +
geom_text(data = df_fam %>% filter(Company == "PG") %>% group_by(Group) %>% summarise(mean_fam = mean(Fam, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_fam, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
ggplot(df_fam %>% filter(Company == "United"), aes(x = factor(Group), y = Fam, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Familiarity for United", x = "Group", y = "Familiarity Value", fill = "Group") +
geom_text(data = df_fam %>% filter(Company == "United") %>% group_by(Group) %>% summarise(mean_fam = mean(Fam, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_fam, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
ggplot(df_fam %>% filter(Company == "Wendys"), aes(x = factor(Group), y = Fam, fill = factor(Group))) +
geom_violin(alpha = 0.5, trim = FALSE) +
coord_cartesian(ylim = c(0, 8)) +
scale_x_discrete(limits = c("0", "1"), labels = c("Like_Carbon_Fam", "Fam_Carbon_Like")) +
stat_compare_means(comparisons = list(c("0", "1")), method = "t.test", label = "p.signif", color = "darkblue") +
scale_fill_manual(values = c("0" = "lightblue", "1" = "blue")) +
labs(title = "Comparison of Familiarity for Wendys", x = "Group", y = "Familiarity Value", fill = "Group") +
geom_text(data = df_fam %>% filter(Company == "Wendys") %>% group_by(Group) %>% summarise(mean_fam = mean(Fam, na.rm = TRUE)),
aes(x = factor(Group), y = 0, label = paste0("Mean = ", round(mean_fam, 2))),
size = 5, color = "darkblue") +
theme_minimal() +
geom_jitter(width = 0.1, alpha = 0.5, color = "black")
lm_group <- lm(Tau ~ Group, data = df_n_length)
lm_poli <- lm(Tau ~ POLITICAL, data = df_n_length)
tab_model(lm_group, lm_poli, show.stat = TRUE, show.ci = FALSE, show.se = TRUE, show.intercept = TRUE)
| Â | Tau | Tau | ||||||
|---|---|---|---|---|---|---|---|---|
| Predictors | Estimates | std. Error | Statistic | p | Estimates | std. Error | Statistic | p |
| (Intercept) | 0.28 | 0.02 | 13.64 | <0.001 | 0.26 | 0.03 | 8.03 | <0.001 |
| Group [1] | -0.03 | 0.03 | -1.02 | 0.307 | ||||
| POLITICAL | 0.00 | 0.01 | 0.46 | 0.649 | ||||
| Observations | 400 | 400 | ||||||
| R2 / R2 adjusted | 0.003 / 0.000 | 0.001 / -0.002 | ||||||
tab_model(M1_1, M1_0, show.stat = TRUE, show.ci = FALSE, show.se = TRUE, show.intercept = TRUE, terms = c("Fam", "Like"))
| Â | ObjRank | ObjRank | ||||||
|---|---|---|---|---|---|---|---|---|
| Predictors | Estimates | std. Error | Statistic | p | Estimates | std. Error | Statistic | p |
| Fam | -0.04 | 0.04 | -1.01 | 0.311 | 0.02 | 0.05 | 0.41 | 0.680 |
| Like | 0.06 | 0.05 | 1.28 | 0.201 | 0.01 | 0.05 | 0.18 | 0.858 |
| Observations | 1400 | 1400 | ||||||
| R2 / R2 adjusted | 0.002 / -0.165 | 0.000 / -0.168 | ||||||
tab_model(M3_1, M3_0, show.stat = TRUE, show.ci = FALSE, show.se = TRUE, show.intercept = TRUE, terms = c("Fam", "Like"))
| Â | Emissions | Emissions | ||||||
|---|---|---|---|---|---|---|---|---|
| Predictors | Estimates | std. Error | Statistic | p | Estimates | std. Error | Statistic | p |
| Fam | 0.01 | 0.04 | 0.23 | 0.817 | 0.01 | 0.05 | 0.30 | 0.762 |
| Like | 0.05 | 0.05 | 1.06 | 0.287 | -0.04 | 0.05 | -0.70 | 0.481 |
| Observations | 1400 | 1400 | ||||||
| R2 / R2 adjusted | 0.001 / -0.167 | 0.000 / -0.167 | ||||||
M1_EST_1 <- summary(M1_1)$coefficients[1:4,]
M1_CI_1 <- confint(M1_1)[1:4,]
M1_DF_1 <- cbind(M1_EST_1, M1_CI_1)
M1_DF_1 <- as.data.frame(M1_DF_1) %>%
mutate(Model = "Model 1") %>%
mutate(Condition = "1")
M1_EST_0 <- summary(M1_0)$coefficients[1:4,]
M1_CI_0 <- confint(M1_0)[1:4,]
M1_DF_0 <- cbind(M1_EST_0, M1_CI_0)
M1_DF_0 <- as.data.frame(M1_DF_0) %>%
mutate(Model = "Model 1") %>%
mutate(Condition = "0")
M3_EST_1 <- summary(M3_1)$coefficients[1:4,]
M3_CI_1 <- confint(M3_1)[1:4,]
M3_DF_1 <- cbind(M3_EST_1, M3_CI_1)
M3_DF_1 <- as.data.frame(M3_DF_1) %>%
mutate(Model = "Model 3") %>%
mutate(Condition = "1")
M3_EST_0 <- summary(M3_0)$coefficients[1:4,]
M3_CI_0 <- confint(M3_0)[1:4,]
M3_DF_0 <- cbind(M3_EST_0, M3_CI_0)
M3_DF_0 <- as.data.frame(M3_DF_0) %>%
mutate(Model = "Model 3") %>%
mutate(Condition = "0")
LensDF <- rbind(M1_DF_1, M1_DF_0, M3_DF_1, M3_DF_0)
LensDF <- LensDF %>%
mutate(Study = "Order Study Pilot")
LensDF <- LensDF[c(2:3, 6:7, 10:11, 14:15),] %>%
rownames_to_column(var = "Coefficient")
LensDF <- LensDF %>%
mutate(Coefficient = case_when(
grepl("^Fam", Coefficient) ~ "Fam",
grepl("^Like", Coefficient) ~ "Like",
grepl("^ObjRank", Coefficient) ~ "ObjRank",
TRUE ~ Coefficient))
LensDF <- LensDF %>%
rename(
Std_Error = `Std. Error`,
T_Value = `t value`,
P_Value = `Pr(>|t|)`,
CI95_Lower = `2.5 %`,
CI95_Upper = `97.5 %`)
LensDF$Study <- (as.factor(LensDF$Study))
LensDF$Condition <- (as.factor(LensDF$Condition))
LensDF$Coefficient <- (as.factor(LensDF$Coefficient))
LensDF <- LensDF %>%
mutate(Model = case_when(
Model == "Model 1" ~ "Normative",
Model == "Model 3" ~ "Descriptive",
TRUE ~ as.character(Model)
))
LensDF <- LensDF %>%
mutate(Condition = case_when(
Condition == "0" ~ "Liking then Familiarity",
Condition == "1" ~ "Familiarity then Liking",
TRUE ~ as.character(Condition)
))
LensDF$Model <- factor(LensDF$Model, levels = c("Normative", "Descriptive"))
LensDF$Condition <- factor(LensDF$Condition, levels = c("Liking then Familiarity", "Familiarity then Liking"))
LensDF <- LensDF %>%
mutate(Coefficient = case_when(
Coefficient == "Like" ~ "Liking",
Coefficient == "Fam" ~ "Familiarity",
TRUE ~ as.character(Coefficient)
))
LensPlot <- ggplot(LensDF, aes(y = Estimate, ymin= CI95_Lower, ymax= CI95_Upper, x = Coefficient, fill = Model, color = Model)) +
geom_bar(stat = "identity", position = position_dodge(width = 0.9), alpha = .25) +
geom_pointrange(position = position_dodge(width = .9), alpha = .75) +
facet_grid(.~Condition) +
xlab("") +
theme_bw() +
theme(strip.background = element_blank(), text = element_text(size = 12), axis.text.x = element_text(angle = 45, hjust = 1)) +
scale_x_discrete(name = "Coefficient") +
facet_grid(. ~ Condition, scales = "free_x") +
scale_fill_manual(values = c("Normative" = "#619CFF", "Descriptive" = "#F8766D")) +
scale_color_manual(values = c("Normative" = "#619CFF", "Descriptive" = "salmon"))
LensPlot