diff --git a/.Rhistory b/.Rhistory index c84bba9..5910395 100644 --- a/.Rhistory +++ b/.Rhistory @@ -1,411 +1,512 @@ -library(tidyverse) -new_nv_tourist <- nv_tourist |> -rename( -handshake_indiff = GImg1, -hug_indiff = GImg2, -kiss_indiff = GImg3, -consent_post = PImg1, -interest_post = PImg2, -neutral_post = PImg3, -reflexive_post = PImg4, -negative_post = PImg5, -relax_score = Tense...relaxed, -anarchic_score = Authoritative..anarchic, -friendly_score = Hostile...friendly, -authoritative = TAudio1, -sarcastic = TAudio2, -friendly = TAudio3, -spitting = QAudio1, -hum = QAudio2, -sigh = QAudio3, -client_type = Type.of.Client -) -knitr::opts_chunk$set(echo = TRUE) -nv_tourist <- read.csv("non-verbal tourist data.csv") -library(tidyverse) -new_nv_tourist <- nv_tourist |> -rename( -handshake_indiff = GImg1, -hug_indiff = GImg2, -kiss_indiff = GImg3, -consent_post = PImg1, -interest_post = PImg2, -neutral_post = PImg3, -reflexive_post = PImg4, -negative_post = PImg5, -relax_score = Tense...relaxed, -anarchic_score = Authoritative..anarchic, -friendly_score = Hostile...friendly, -authoritative = TAudio1, -sarcastic = TAudio2, -friendly = TAudio3, -spitting = QAudio1, -hum = QAudio2, -sigh = QAudio3, -client_type = Type.of.Client -) -new_nv_tourist -# checking for missing values... -for(curr_col in seq(1, ncol(new_nv_tourist))) { -print(sum(new_nv_tourist[curr_col] == "?")) -} -# should figure out what method to use to deal with missing values! -library(tidyverse) -new_nv_tourist <- nv_tourist |> -rename( -handshake_indiff = GImg1, -hug_indiff = GImg2, -kiss_indiff = GImg3, -consent_post = PImg1, -interest_post = PImg2, -neutral_post = PImg3, -reflexive_post = PImg4, -negative_post = PImg5, -relax_score = Tense...relaxed, -anarchic_score = Authoritative..anarchic, -friendly_score = Hostile...friendly, -authoritative = TAudio1, -sarcastic = TAudio2, -friendly = TAudio3, -spitting = QAudio1, -hum = QAudio2, -sigh = QAudio3, -client_type = Type.of.Client -) -new_nv_tourist -# checking for missing values... -for(curr_col in seq(1, ncol(new_nv_tourist))) { -print(curr_col + " " + sum(new_nv_tourist[curr_col] == "?")) -} -library(tidyverse) -new_nv_tourist <- nv_tourist |> -rename( -handshake_indiff = GImg1, -hug_indiff = GImg2, -kiss_indiff = GImg3, -consent_post = PImg1, -interest_post = PImg2, -neutral_post = PImg3, -reflexive_post = PImg4, -negative_post = PImg5, -relax_score = Tense...relaxed, -anarchic_score = Authoritative..anarchic, -friendly_score = Hostile...friendly, -authoritative = TAudio1, -sarcastic = TAudio2, -friendly = TAudio3, -spitting = QAudio1, -hum = QAudio2, -sigh = QAudio3, -client_type = Type.of.Client -) -new_nv_tourist -# checking for missing values... -for(curr_col in seq(1, ncol(new_nv_tourist))) { -print(new_nv_tourist[curr_col] + " " + sum(new_nv_tourist[curr_col] == "?")) -} -library(tidyverse) -new_nv_tourist <- nv_tourist |> -rename( -handshake_indiff = GImg1, -hug_indiff = GImg2, -kiss_indiff = GImg3, -consent_post = PImg1, -interest_post = PImg2, -neutral_post = PImg3, -reflexive_post = PImg4, -negative_post = PImg5, -relax_score = Tense...relaxed, -anarchic_score = Authoritative..anarchic, -friendly_score = Hostile...friendly, -authoritative = TAudio1, -sarcastic = TAudio2, -friendly = TAudio3, -spitting = QAudio1, -hum = QAudio2, -sigh = QAudio3, -client_type = Type.of.Client -) -new_nv_tourist -# checking for missing values... -for(curr_col in seq(1, ncol(new_nv_tourist))) { -print(name(new_nv_tourist[curr_col])) -print(sum(new_nv_tourist[curr_col] == "?")) -} -library(tidyverse) -new_nv_tourist <- nv_tourist |> -rename( -handshake_indiff = GImg1, -hug_indiff = GImg2, -kiss_indiff = GImg3, -consent_post = PImg1, -interest_post = PImg2, -neutral_post = PImg3, -reflexive_post = PImg4, -negative_post = PImg5, -relax_score = Tense...relaxed, -anarchic_score = Authoritative..anarchic, -friendly_score = Hostile...friendly, -authoritative = TAudio1, -sarcastic = TAudio2, -friendly = TAudio3, -spitting = QAudio1, -hum = QAudio2, -sigh = QAudio3, -client_type = Type.of.Client -) -new_nv_tourist -# checking for missing values... -for(curr_col in seq(1, ncol(new_nv_tourist))) { -print(new_nv_tourist[curr_col]) -print(sum(new_nv_tourist[curr_col] == "?")) -} -# should figure out what method to use to deal with missing values! -nv_tourist <- read.csv("non-verbal tourist data.csv") -library(tidyverse) -new_nv_tourist <- nv_tourist |> -rename( -handshake_indiff = GImg1, -hug_indiff = GImg2, -kiss_indiff = GImg3, -consent_post = PImg1, -interest_post = PImg2, -neutral_post = PImg3, -reflexive_post = PImg4, -negative_post = PImg5, -relax_score = Tense...relaxed, -anarchic_score = Authoritative..anarchic, -friendly_score = Hostile...friendly, -authoritative = TAudio1, -sarcastic = TAudio2, -friendly = TAudio3, -spitting = QAudio1, -hum = QAudio2, -sigh = QAudio3, -client_type = Type.of.Client -) -new_nv_tourist -# checking for missing values... -for(curr_col in seq(1, ncol(new_nv_tourist))) { -print(sum(new_nv_tourist[curr_col] == "?")) -} -# should figure out what method to use to deal with missing values! -library(tidyverse) -new_nv_tourist <- nv_tourist |> -rename( -handshake_indiff = GImg1, -hug_indiff = GImg2, -kiss_indiff = GImg3, -consent_post = PImg1, -interest_post = PImg2, -neutral_post = PImg3, -reflexive_post = PImg4, -negative_post = PImg5, -relax_score = Tense...relaxed, -anarchic_score = Authoritative..anarchic, -friendly_score = Hostile...friendly, -authoritative = TAudio1, -sarcastic = TAudio2, -friendly = TAudio3, -spitting = QAudio1, -hum = QAudio2, -sigh = QAudio3, -client_type = Type.of.Client -) -new_nv_tourist -# checking for missing values... -for(curr_col in seq(1, ncol(new_nv_tourist))) { -print(new_nv_tourist[cur_col]) -# print(sum(new_nv_tourist[curr_col] == "?")) -} -library(tidyverse) -new_nv_tourist <- nv_tourist |> -rename( -handshake_indiff = GImg1, -hug_indiff = GImg2, -kiss_indiff = GImg3, -consent_post = PImg1, -interest_post = PImg2, -neutral_post = PImg3, -reflexive_post = PImg4, -negative_post = PImg5, -relax_score = Tense...relaxed, -anarchic_score = Authoritative..anarchic, -friendly_score = Hostile...friendly, -authoritative = TAudio1, -sarcastic = TAudio2, -friendly = TAudio3, -spitting = QAudio1, -hum = QAudio2, -sigh = QAudio3, -client_type = Type.of.Client -) -new_nv_tourist -# checking for missing values... -for(curr_col in seq(1, ncol(new_nv_tourist))) { -print(new_nv_tourist[curr_col]) -# print(sum(new_nv_tourist[curr_col] == "?")) -} -# should figure out what method to use to deal with missing values! -View(new_nv_tourist) -library(tidyverse) -new_nv_tourist <- nv_tourist |> -rename( -handshake_indiff = GImg1, -hug_indiff = GImg2, -kiss_indiff = GImg3, -consent_post = PImg1, -interest_post = PImg2, -neutral_post = PImg3, -reflexive_post = PImg4, -negative_post = PImg5, -relax_score = Tense...relaxed, -anarchic_score = Authoritative..anarchic, -friendly_score = Hostile...friendly, -authoritative = Proxemics, -sarcastic = TAudio2, -friendly = TAudio3, -spitting = QAudio1, -hum = QAudio2, -sigh = QAudio3, -proxemics = TAudio1, -client_type = Type.of.Client -) -new_nv_tourist -# checking for missing values... -for(curr_col in seq(1, ncol(new_nv_tourist))) { -print(new_nv_tourist[curr_col]) -# print(sum(new_nv_tourist[curr_col] == "?")) -} -# should figure out what method to use to deal with missing values! -# checking for missing values... -for(curr_col in seq(1, ncol(new_nv_tourist))) { -print(new_nv_tourist[curr_col]) -# print(sum(new_nv_tourist[curr_col] == "?")) -} -# should figure out what method to use to deal with missing values! -library(tidyverse) -new_nv_tourist <- nv_tourist |> -rename( -handshake_indiff = GImg1, -hug_indiff = GImg2, -kiss_indiff = GImg3, -consent_post = PImg1, -interest_post = PImg2, -neutral_post = PImg3, -reflexive_post = PImg4, -negative_post = PImg5, -relax_score = Tense...relaxed, -anarchic_score = Authoritative..anarchic, -friendly_score = Hostile...friendly, -authoritative = Proxemics, -sarcastic = TAudio2, -friendly = TAudio3, -spitting = QAudio1, -hum = QAudio2, -sigh = QAudio3, -proxemics = TAudio1, -client_type = Type.of.Client -) -new_nv_tourist -View(new_nv_tourist) -# checking for missing values... -for(curr_col in seq(1, ncol(new_nv_tourist))) { -print(new_nv_tourist[curr_col,]) -# print(sum(new_nv_tourist[curr_col] == "?")) -} -# should figure out what method to use to deal with missing values! -# checking for missing values... -for(curr_col in seq(1, nrow(new_nv_tourist))) { -print(new_nv_tourist[curr_col,]) -# print(sum(new_nv_tourist[curr_col] == "?")) -} -# should figure out what method to use to deal with missing values! -# checking for missing values... -contains_missing <- function(row) { -any(row == "?") -} -rows_w_missing_val <- apply(new_nv_tourist, 1, contains_missing) -print(df[rows_w_missing_val,]) -# checking for missing values... -contains_missing <- function(row) { -any(row == "?") -} -rows_w_missing_val <- apply(new_nv_tourist, 1, contains_missing) -print(new_nv_tourist[rows_w_missing_val,]) -# should figure out what method to use to deal with missing values! -knitr::opts_chunk$set(echo = TRUE) -new_nv_tourist <- new_nv_tourist[-rows_w_missing_val,] -nv_tourist <- read.csv("non-verbal tourist data.csv") -library(tidyverse) -new_nv_tourist <- nv_tourist |> -rename( -handshake_indiff = GImg1, -hug_indiff = GImg2, -kiss_indiff = GImg3, -consent_post = PImg1, -interest_post = PImg2, -neutral_post = PImg3, -reflexive_post = PImg4, -negative_post = PImg5, -relax_score = Tense...relaxed, -anarchic_score = Authoritative..anarchic, -friendly_score = Hostile...friendly, -authoritative = Proxemics, -sarcastic = TAudio2, -friendly = TAudio3, -spitting = QAudio1, -hum = QAudio2, -sigh = QAudio3, -proxemics = TAudio1, -client_type = Type.of.Client -) -# checking for missing values... -# the dataset uses "?" to indicate a missing value -contains_missing <- function(row) { -any(row == "?") -} -rows_w_missing_val <- apply(new_nv_tourist, 1, contains_missing) -print(new_nv_tourist[rows_w_missing_val,]) -new_nv_tourist <- new_nv_tourist[-rows_w_missing_val,] -View(new_nv_tourist) -# checking for missing values... -# the dataset uses "?" to indicate a missing value -contains_missing <- function(row) { -any(row == "?") -} -rows_w_missing_val <- apply(new_nv_tourist, 1, contains_missing) -print(new_nv_tourist[rows_w_missing_val,]) -new_nv_tourist <- new_nv_tourist[!rows_w_missing_val,] -nv_tourist <- read.csv("non-verbal tourist data.csv") -library(tidyverse) -new_nv_tourist <- nv_tourist |> -rename( -handshake_indiff = GImg1, -hug_indiff = GImg2, -kiss_indiff = GImg3, -consent_post = PImg1, -interest_post = PImg2, -neutral_post = PImg3, -reflexive_post = PImg4, -negative_post = PImg5, -relax_score = Tense...relaxed, -anarchic_score = Authoritative..anarchic, -friendly_score = Hostile...friendly, -authoritative = Proxemics, -sarcastic = TAudio2, -friendly = TAudio3, -spitting = QAudio1, -hum = QAudio2, -sigh = QAudio3, -proxemics = TAudio1, -client_type = Type.of.Client -) -# checking for missing values... -# the dataset uses "?" to indicate a missing value -contains_missing <- function(row) { -any(row == "?") -} -rows_w_missing_val <- apply(new_nv_tourist, 1, contains_missing) -print(new_nv_tourist[rows_w_missing_val,]) -new_nv_tourist <- new_nv_tourist[!rows_w_missing_val,] +geom_bar(aes(x = handshake_indiff, fill = sex), position = "stack") + +geom_bar(aes(x = hug_indiff, fill = sex), position = "stack") + +geom_bar(aes(x = kiss_indiff, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Gesture Perception by Sex") + +facet_wrap(~ c("Handshake", "Hug", "Kiss"), nrow = 1) + +theme_minimal() +# GRAPH 2 +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = handshake_indiff, fill = country), position = "stack") + +geom_bar(aes(x = hug_indiff, fill = country), position = "stack") + +geom_bar(aes(x = kiss_indiff, fill = country), position = "stack") + +labs(x = "Perception", y = "Count", title = "Gesture Perception by Country") + +facet_wrap(~ c("Handshake", "Hug", "Kiss"), nrow = 1) + +theme_minimal() +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "Perception", y = "Count", title = "Authoritative") + +theme_minimal() +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(y = "Count", title = "Sarcastic") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = "Tone Perception by Sex", +bottom = "Perception") +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "Perception", y = "Count", title = "Authoritative") + +theme(legend.position - "none") = +theme_minimal() +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "Perception", y = "Count", title = "Authoritative") + +theme(legend.position - "none") + +theme_minimal() +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "Perception", y = "Count", title = "Authoritative") + +theme(legend.position = "none") + +theme_minimal() +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(title = "Sarcastic") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = "Tone Perception by Sex", +bottom = "Perception") +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "Perception", y = "Count", title = "Authoritative") + +theme(legend.position = "none") +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(title = "Sarcastic") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = "Tone Perception by Sex", +bottom = "Perception") +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "Perception", y = "Count", title = "Authoritative") + +theme_minimal(legend.position = "none") +?theme_minimal +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "Perception", y = "Count", title = "Authoritative") + +theme_minimal() + +theme(legend.position = "none") +?theme_minimal +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(title = "Sarcastic") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = "Tone Perception by Sex", +bottom = "Perception") +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(y = "Count", title = "Authoritative") + +theme_minimal() + +theme(legend.position = "none") +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(y = "Count", title = "Sarcastic") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = "Tone Perception by Sex", +bottom = "Perception") +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(y = "Count", title = "Authoritative") + +theme_minimal() + +theme(legend.position = "none") +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(y = "Count", title = "Sarcastic") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = "Tone Perception by Sex", +bottom = "Perception") +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(y = "Count") + +theme_minimal() + +theme(legend.position = "none") +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(y = "Count") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = "Tone Perception by Sex", +bottom = "Perception") +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "", y = "Count", title = "Authoritative") + +theme_minimal() + +theme(legend.position = "none") +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(x = "", y = "Count", title = "Sarcastic") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = "Tone Perception by Sex", +bottom = "Perception") +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "", y = "Count", title = "Authoritative") + +theme_minimal() + +theme(legend.position = "none") +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(x = "", y = "Count", title = "Sarcastic") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = textGrob("Tone Perception by Sex", vjust = 1.5), +bottom = "Perception") +library(grid) +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "", y = "Count", title = "Authoritative") + +theme_minimal() + +theme(legend.position = "none") +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(x = "", y = "Count", title = "Sarcastic") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = textGrob("Tone Perception by Sex", vjust = 1.5), +bottom = "Perception") +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "", y = "Count", title = "Authoritative") + +theme_minimal() + +theme(legend.position = "none") +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(x = "", y = "Count", title = "Sarcastic") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = textGrob("Tone Perception by Sex", vjust = 3), +bottom = "Perception") +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "", y = "Count", title = "Authoritative") + +theme_minimal() + +theme(legend.position = "none") +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(x = "", y = "Count", title = "Sarcastic") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = textGrob("Tone Perception by Sex", vjust = -1), +bottom = "Perception") +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "", y = "Count", title = "Authoritative") + +theme_minimal() + +theme(legend.position = "none") +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(x = "", y = "Count", title = "Sarcastic") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = textGrob("Tone Perception by Sex", vjust = 0), +bottom = "Perception") +table(new_nv_tourist$sex, new_nv_tourist$authoritative) +table(new_nv_tourist$sex, new_nv_tourist$sarcastic) +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "", y = "Count", title = "Authoritative") + +theme_minimal() + +theme(legend.position = "none") +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + +geom_bar(position = "stack") + +labs(x = "", y = "Count", title = "Sarcastic") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = "Tone Perception by Sex", +bottom = "Perception") +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = spitting, fill = sex), position = "stack") + +geom_bar(aes(x = hum, fill = sex), position = "stack") + +geom_bar(aes(x = sigh, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Quasi-Lexicon Perception by Sex") + +facet_wrap(~ c("Spitting", "Hum", "Sigh"), nrow = 1) + +theme_minimal() +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = spitting, fill = sex), position = "stack") + +geom_bar(aes(x = hum, fill = sex), position = "stack") + +geom_bar(aes(x = sigh, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Quasi-Lexicon Perception by Sex") + +facet_wrap(~ c("Spitting", "Hum", "Sigh"), nrow = 1) + +theme_minimal() +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = proxemic, fill = sex), position = "stack") + +theme_minimal() +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = proxemic, fill = sex), position = "stack") + +labs(x = "Proxemic", y = "Count", title = "Proxemic Perception by Sex") +theme_minimal() +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = proxemic, fill = sex), position = "stack") + +labs(x = "Proxemic", y = "Count", title = "Proxemic Perception by Sex") + +theme_minimal() +# this barplot is acting weird with the stacks... +# GRAPH 1 +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = handshake_indiff, fill = sex), position = "dodge") + +geom_bar(aes(x = hug_indiff, fill = sex), position = "dodge") + +geom_bar(aes(x = kiss_indiff, fill = sex), position = "dodge") + +labs(x = "Perception", y = "Count", title = "Gesture Perception by Sex") + +facet_wrap(~ c("Handshake", "Hug", "Kiss"), nrow = 1) + +theme_minimal() +# GRAPH 2 +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = handshake_indiff, fill = country), position = "dodge") + +geom_bar(aes(x = hug_indiff, fill = country), position = "dodge") + +geom_bar(aes(x = kiss_indiff, fill = country), position = "dodge") + +labs(x = "Perception", y = "Count", title = "Gesture Perception by Country") + +facet_wrap(~ c("Handshake", "Hug", "Kiss"), nrow = 1) + +theme_minimal() +# this barplot is acting weird with the stacks... +# GRAPH 1 +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = handshake_indiff, fill = sex), position = "dodge") + +geom_bar(aes(x = hug_indiff, fill = sex), position = "dodge") + +geom_bar(aes(x = kiss_indiff, fill = sex), position = "dodge") + +labs(x = "Perception", y = "Count", title = "Gesture Perception by Sex") + +facet_wrap(~ c("Handshake", "Hug", "Kiss"), nrow = 1) + +theme_minimal() +# GRAPH 2 +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = handshake_indiff, fill = country), position = "dodge") + +geom_bar(aes(x = hug_indiff, fill = country), position = "dodge") + +geom_bar(aes(x = kiss_indiff, fill = country), position = "dodge") + +labs(x = "Perception", y = "Count", title = "Gesture Perception by Country") + +facet_wrap(~ c("Handshake", "Hug", "Kiss"), nrow = 1) + +theme_minimal() +table(new_nv_tourist$sex, new_nv_tourist$consent_post) +table(new_nv_tourist$sex, new_nv_tourist$interest_post) +table(new_nv_tourist$sex, new_nv_tourist$neutral_post) +table(new_nv_tourist$sex, new_nv_tourist$reflexive_post) +table(new_nv_tourist$sex, new_nv_tourist$negative_post) +# this barplot is acting weird with the stacks... +# GRAPH 1 +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = handshake_indiff, fill = sex), position = "stack") + +geom_bar(aes(x = hug_indiff, fill = sex), position = "stack") + +geom_bar(aes(x = kiss_indiff, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Gesture Perception by Sex") + +facet_wrap(~ c("Handshake", "Hug", "Kiss"), nrow = 1) + +theme_minimal() +# GRAPH 2 +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = handshake_indiff, fill = country), position = "stack") + +geom_bar(aes(x = hug_indiff, fill = country), position = "stack") + +geom_bar(aes(x = kiss_indiff, fill = country), position = "stack") + +labs(x = "Perception", y = "Count", title = "Gesture Perception by Country") + +facet_wrap(~ c("Handshake", "Hug", "Kiss"), nrow = 2) + +theme_minimal() +# this barplot is acting weird with the stacks... +# GRAPH 1 +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = handshake_indiff, fill = sex), position = "stack") + +geom_bar(aes(x = hug_indiff, fill = sex), position = "stack") + +geom_bar(aes(x = kiss_indiff, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Gesture Perception by Sex") + +facet_wrap(~ c("Handshake", "Hug", "Kiss"), nrow = 1) + +theme_minimal() +# GRAPH 2 +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = handshake_indiff, fill = country), position = "stack") + +geom_bar(aes(x = hug_indiff, fill = country), position = "stack") + +geom_bar(aes(x = kiss_indiff, fill = country), position = "stack") + +labs(x = "Perception", y = "Count", title = "Gesture Perception by Country") + +facet_wrap(~ c("Handshake", "Hug", "Kiss"), nrow = 1) + +theme_minimal() +table(new_nv_tourist$sex, new_nv_tourist$consent_post) +table(new_nv_tourist$sex, new_nv_tourist$interest_post) +table(new_nv_tourist$sex, new_nv_tourist$neutral_post) +table(new_nv_tourist$sex, new_nv_tourist$reflexive_post) +table(new_nv_tourist$sex, new_nv_tourist$negative_post) +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = consent_post, fill = sex), position = "stack") + +geom_bar(aes(x = interest_post, fill = sex), position = "stack") + +geom_bar(aes(x = neutral_post, fill = sex), position = "stack") + +geom_bar(aes(x = reflexive_post, fill = sex), position = "stack") + +geom_bar(aes(x = negative_post, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Posture Perception by Sex") + +facet_wrap(~ c("Consent", "Interest", "Neutral", "Reflexive", "Negative"), nrow = 2) + +theme_minimal() +table(new_nv_tourist$sex, new_nv_tourist$consent_post) +table(new_nv_tourist$sex, new_nv_tourist$interest_post) +table(new_nv_tourist$sex, new_nv_tourist$neutral_post) +table(new_nv_tourist$sex, new_nv_tourist$reflexive_post) +table(new_nv_tourist$sex, new_nv_tourist$negative_post) +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = consent_post, fill = sex), position = "stack") + +geom_bar(aes(x = interest_post, fill = sex), position = "stack") + +geom_bar(aes(x = neutral_post, fill = sex), position = "stack") + +geom_bar(aes(x = reflexive_post, fill = sex), position = "stack") + +geom_bar(aes(x = negative_post, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Posture Perception by Sex") + +facet_wrap(c("Consent", "Interest", "Neutral", "Reflexive", "Negative"), nrow = 2) + +theme_minimal() +table(new_nv_tourist$sex, new_nv_tourist$consent_post) +table(new_nv_tourist$sex, new_nv_tourist$interest_post) +table(new_nv_tourist$sex, new_nv_tourist$neutral_post) +table(new_nv_tourist$sex, new_nv_tourist$reflexive_post) +table(new_nv_tourist$sex, new_nv_tourist$negative_post) +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = consent_post, fill = sex), position = "stack") + +geom_bar(aes(x = interest_post, fill = sex), position = "stack") + +geom_bar(aes(x = neutral_post, fill = sex), position = "stack") + +geom_bar(aes(x = reflexive_post, fill = sex), position = "stack") + +geom_bar(aes(x = negative_post, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Posture Perception by Sex") + +facet_wrap(~c("Consent", "Interest", "Neutral", "Reflexive", "Negative"), nrow = 2) + +theme_minimal() +table(new_nv_tourist$sex, new_nv_tourist$consent_post) +table(new_nv_tourist$sex, new_nv_tourist$interest_post) +table(new_nv_tourist$sex, new_nv_tourist$neutral_post) +table(new_nv_tourist$sex, new_nv_tourist$reflexive_post) +table(new_nv_tourist$sex, new_nv_tourist$negative_post) +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = consent_post, fill = sex), position = "stack") + +geom_bar(aes(x = interest_post, fill = sex), position = "stack") + +geom_bar(aes(x = neutral_post, fill = sex), position = "stack") + +geom_bar(aes(x = reflexive_post, fill = sex), position = "stack") + +geom_bar(aes(x = negative_post, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Posture Perception by Sex") + +facet_wrap(~c("Consent", "Interest", "Neutral", "Reflexive", "Negative"), nrow = 5) + +theme_minimal() +table(new_nv_tourist$sex, new_nv_tourist$consent_post) +table(new_nv_tourist$sex, new_nv_tourist$interest_post) +table(new_nv_tourist$sex, new_nv_tourist$neutral_post) +table(new_nv_tourist$sex, new_nv_tourist$reflexive_post) +table(new_nv_tourist$sex, new_nv_tourist$negative_post) +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = consent_post, fill = sex), position = "stack") + +geom_bar(aes(x = interest_post, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Posture Perception by Sex") + +facet_wrap(~c("Consent", "Interest", "Neutral", "Reflexive", "Negative"), nrow = 5) + +theme_minimal() +table(new_nv_tourist$sex, new_nv_tourist$consent_post) +table(new_nv_tourist$sex, new_nv_tourist$interest_post) +table(new_nv_tourist$sex, new_nv_tourist$neutral_post) +table(new_nv_tourist$sex, new_nv_tourist$reflexive_post) +table(new_nv_tourist$sex, new_nv_tourist$negative_post) +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = consent_post, fill = sex), position = "stack") + +geom_bar(aes(x = interest_post, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Posture Perception by Sex") + +facet_wrap(~c("Consent", "Interest"), nrow = 1) + +theme_minimal() +table(new_nv_tourist$sex, new_nv_tourist$consent_post) +table(new_nv_tourist$sex, new_nv_tourist$interest_post) +table(new_nv_tourist$sex, new_nv_tourist$neutral_post) +table(new_nv_tourist$sex, new_nv_tourist$reflexive_post) +table(new_nv_tourist$sex, new_nv_tourist$negative_post) +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = consent_post, fill = sex), position = "stack") + +geom_bar(aes(x = interest_post, fill = sex), position = "stack") + +geom_bar(aes(x = neutral_post, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Posture Perception by Sex") + +facet_wrap(~c("Consent", "Interest", "Neutral"), nrow = 1) + +theme_minimal() +table(new_nv_tourist$sex, new_nv_tourist$consent_post) +table(new_nv_tourist$sex, new_nv_tourist$interest_post) +table(new_nv_tourist$sex, new_nv_tourist$neutral_post) +table(new_nv_tourist$sex, new_nv_tourist$reflexive_post) +table(new_nv_tourist$sex, new_nv_tourist$negative_post) +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = consent_post, fill = sex), position = "stack") + +geom_bar(aes(x = interest_post, fill = sex), position = "stack") + +geom_bar(aes(x = neutral_post, fill = sex), position = "stack") + +geom_bar(aes(x = reflexive_post, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Posture Perception by Sex") + +facet_wrap(~c("Consent", "Interest", "Neutral", "Reflexive"), nrow = 2) + +theme_minimal() +table(new_nv_tourist$sex, new_nv_tourist$consent_post) +table(new_nv_tourist$sex, new_nv_tourist$interest_post) +table(new_nv_tourist$sex, new_nv_tourist$neutral_post) +table(new_nv_tourist$sex, new_nv_tourist$reflexive_post) +table(new_nv_tourist$sex, new_nv_tourist$negative_post) +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = consent_post, fill = sex), position = "stack") + +geom_bar(aes(x = interest_post, fill = sex), position = "stack") + +geom_bar(aes(x = neutral_post, fill = sex), position = "stack") + +geom_bar(aes(x = reflexive_post, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Posture Perception by Sex") + +facet_wrap(~c("Consent", "Interest", "Neutral", "Reflexive"), nrow = 2, ncol = 2) + +theme_minimal() +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = consent_post, fill = sex), position = "stack") + +geom_bar(aes(x = interest_post, fill = sex), position = "stack") + +geom_bar(aes(x = neutral_post, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Posture Perception by Sex") + +facet_wrap(~c("Consent", "Interest", "Neutral"), nrow = 1) + +theme_minimal() +plot1 <- ggplot(new_nv_tourist, aes(x = reflexive_post, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "", y = "Count", title = "Reflexive") + +theme_minimal() + +theme(legend.position = "none") +plot2 <- ggplot(new_nv_tourist, aes(x = negative_post, fill = sex)) + +geom_bar(position = "stack") + +labs(x = "", y = "Count", title = "Negative") + +theme_minimal() +grid.arrange(plot1, plot2, nrow = 1, +top = "Posture Perception by Sex 2", +bottom = "Perception") +?theme_minimal +?theme +new_nv_tourist |> +ggplot() + +geom_bar(aes(x = consent_post, fill = sex), position = "stack") + +geom_bar(aes(x = interest_post, fill = sex), position = "stack") + +geom_bar(aes(x = neutral_post, fill = sex), position = "stack") + +labs(x = "Perception", y = "Count", title = "Posture Perception by Sex") + +facet_wrap(~c("Consent", "Interest", "Neutral"), nrow = 1) + +theme_minimal() +plot1 <- ggplot(new_nv_tourist, aes(x = reflexive_post, fill = sex)) + +geom_bar(position = "stack", legend = FALSE) + +labs(x = "", y = "Count", title = "Reflexive") + +theme_minimal() + +theme(legend.position = "none", +plot.title = element_text(size = 9)) +plot2 <- ggplot(new_nv_tourist, aes(x = negative_post, fill = sex)) + +geom_bar(position = "stack") + +labs(x = "", y = "Count", title = "Negative") + +theme_minimal() + +theme(plot.title = element_text(size = 9)) +grid.arrange(plot1, plot2, nrow = 1, +top = "Posture Perception by Sex 2", +bottom = "Perception") diff --git a/DATA-2010_Project.Rmd b/DATA-2010_Project.Rmd index 5c6ec3e..45dd1b7 100644 --- a/DATA-2010_Project.Rmd +++ b/DATA-2010_Project.Rmd @@ -11,12 +11,18 @@ knitr::opts_chunk$set(echo = TRUE) ## DATA 2010 Project +```{r} + +library(ggplot2) +library(gridExtra) + +``` + ```{r} nv_tourist <- read.csv("non-verbal tourist data.csv") ``` -Note: Original dataset switched TAudio1 and Proxemics -new_nv_tourist rectified this error +Note: Original dataset switched TAudio1 and Proxemics new_nv_tourist rectified this error ```{r} @@ -40,17 +46,19 @@ new_nv_tourist <- nv_tourist |> spitting = QAudio1, hum = QAudio2, sigh = QAudio3, - proxemics = TAudio1, + proxemic = TAudio1, client_type = Type.of.Client ) + ``` ```{r} + # checking for missing values... # the dataset uses "?" to indicate a missing value contains_missing <- function(row) { - any(row == "?") + any(row == "?") || any(is.na(row)) } rows_w_missing_val <- apply(new_nv_tourist, 1, contains_missing) @@ -61,5 +69,146 @@ print(new_nv_tourist[rows_w_missing_val,]) Based off the results, it seems the missing values fall under MAR (missing at random). We decided to simply delete the rows that contained any missing values, since it is just 4 rows out of the total 73. Thus, it meets the 5-10% range for deletion in MAR. ```{r} + new_nv_tourist <- new_nv_tourist[!rows_w_missing_val,] -``` \ No newline at end of file + +``` + +```{r} + +new_nv_tourist$anarchic_score <- as.numeric(new_nv_tourist$anarchic_score) + +``` + +### Data Exploration + +Gesture + +```{r} + +# this barplot is acting weird with the stacks... + +# GRAPH 1 +new_nv_tourist |> + ggplot() + + geom_bar(aes(x = handshake_indiff, fill = sex), position = "stack") + + geom_bar(aes(x = hug_indiff, fill = sex), position = "stack") + + geom_bar(aes(x = kiss_indiff, fill = sex), position = "stack") + + labs(x = "Perception", y = "Count", title = "Gesture Perception by Sex") + + facet_wrap(~ c("Handshake", "Hug", "Kiss"), nrow = 1) + + theme_minimal() + + +# GRAPH 2 +new_nv_tourist |> + ggplot() + + geom_bar(aes(x = handshake_indiff, fill = country), position = "stack") + + geom_bar(aes(x = hug_indiff, fill = country), position = "stack") + + geom_bar(aes(x = kiss_indiff, fill = country), position = "stack") + + labs(x = "Perception", y = "Count", title = "Gesture Perception by Country") + + facet_wrap(~ c("Handshake", "Hug", "Kiss"), nrow = 1) + + theme_minimal() + +``` + +Posture + +```{r} + +new_nv_tourist |> + ggplot() + + geom_bar(aes(x = consent_post, fill = sex), position = "stack") + + geom_bar(aes(x = interest_post, fill = sex), position = "stack") + + geom_bar(aes(x = neutral_post, fill = sex), position = "stack") + + labs(x = "Perception", y = "Count", title = "Posture Perception by Sex") + + facet_wrap(~c("Consent", "Interest", "Neutral"), nrow = 1) + + theme_minimal() + +plot1 <- ggplot(new_nv_tourist, aes(x = reflexive_post, fill = sex)) + + geom_bar(position = "stack") + + labs(x = "", y = "Count", title = "Reflexive") + + theme_minimal() + + theme(legend.position = "none", + plot.title = element_text(size = 9)) + +plot2 <- ggplot(new_nv_tourist, aes(x = negative_post, fill = sex)) + + geom_bar(position = "stack") + + labs(x = "", y = "Count", title = "Negative") + + theme_minimal() + + theme(plot.title = element_text(size = 9)) + +grid.arrange(plot1, plot2, nrow = 1, + top = "Posture Perception by Sex 2", + bottom = "Perception") + +``` + +Emotional Atmosphere + +```{r} + +find_mode <- function(vector) { + names(sort(table(as.character(vector)), decreasing =TRUE)[1]) +} + +new_nv_tourist |> + group_by(sex) |> + summarise(avg_relax = mean(relax_score), + avg_anarchic = mean(anarchic_score), + avg_friendly = mean(friendly_score), + mode_relax = find_mode(relax_score), + mode_anarchic = find_mode(anarchic_score), + mode_friendly = find_mode(friendly_score)) +``` + +Tone + +```{r} + +plot1 <- ggplot(new_nv_tourist, aes(x = authoritative, fill = sex)) + + geom_bar(position = "stack") + + labs(x = "", y = "Count", title = "Authoritative") + + theme_minimal() + + theme(legend.position = "none", + plot.title = element_text(size = 9)) + +plot2 <- ggplot(new_nv_tourist, aes(x = sarcastic, fill = sex)) + + geom_bar(position = "stack") + + labs(x = "", y = "Count", title = "Sarcastic") + + theme_minimal() + + theme(plot.title = element_text(size = 9)) + +grid.arrange(plot1, plot2, nrow = 1, + top = "Tone Perception by Sex", + bottom = "Perception") + +``` + +Quasi Lexicon + +```{r} + +# there's something weird happening in this bar plot + +new_nv_tourist |> + ggplot() + + geom_bar(aes(x = spitting, fill = sex), position = "stack") + + geom_bar(aes(x = hum, fill = sex), position = "stack") + + geom_bar(aes(x = sigh, fill = sex), position = "stack") + + labs(x = "Perception", y = "Count", title = "Quasi-Lexicon Perception by Sex") + + facet_wrap(~ c("Spitting", "Hum", "Sigh"), nrow = 1) + + theme_minimal() + +``` + +Proxemic + +```{r} + +new_nv_tourist |> + ggplot() + + geom_bar(aes(x = proxemic, fill = sex), position = "stack") + + labs(x = "Proxemic", y = "Count", title = "Proxemic Perception by Sex") + + theme_minimal() + +``` diff --git a/DATA-2010_Project.pdf b/DATA-2010_Project.pdf index 2cc33c3..8d9a217 100644 Binary files a/DATA-2010_Project.pdf and b/DATA-2010_Project.pdf differ