#most latest version with cleaned data

new_df <- rbind(Survey_200_responses, Survey_41_responses)


sorted_data <- sort(Survey_PT$language2_used_posting_SM, decreasing = FALSE, na.last = NA)
scatter_language_spoken <- ggplot(sorted_data, aes(language2_used_regularly))
scatter_language_spoken + geom_bar(aes(x=language2_used_regularly))
scatter_language_spoken + geom_histogram(aes(y=..density..), binwidth=1, color="black", fill="white") + stat_function(fun = dnorm, args =list(mean = mean(Survey_PT$language2_used_posting_SM), sd = sd(Survey_PT$language2_used_posting_SM)))

familiarity_mapping <- c("I have never heard of it before" = 0, "I have heard of it but I am not familiar with it" = 1, "I am somewhat familiar with it" = 2, "I am very familiar with it" = 3)
survey_PT$familiarity_MT <- familiarity_mapping[survey_PT$familiarity_MT]
is.numeric(Survey_PT$familiarity_MT)

#Survey_PT$familiarity_MT <- revalue(Survey_PT$familiarity_MT, c("I have never heard of it before" = "0", "I have heard of it but I am not familiar with it" = "1", "I am somewhat familiar with it" = "3", "I am very familiar with it" = "4"))
#Survey_PT$famliarity_MT <- as.factor(Survey_PT$familiarity_MT)
#Survey_PT$familiarity_MT <- as.numeric(Survey_PT$familiarity_MT)
#is.numeric(Survey_PT$familiarity_MT)

#frequency_writing_other_language_factor <- as.factor(Survey_PT$frequency_of_writing_in_other_language)

mapping_frequency_SM_usage <- c("Never / not anymore" = 0, "Less than once a month" = 1, "A few times a month" = 2, "About once a week" = 3, "A few times a week" = 4, "Almost everyday" = 5, "More than once per day" = 6)
Survey_PT$frequency_SM_usage <- mapping_frequency_SM_usage[Survey_PT$frequency_SM_usage]

#Survey_PT$frequency_SM_usage <- revalue(Survey_PT$frequency_SM_usage, c("Never / not anymore" = "0", "Less than once a month" = "1", "A few times a month" = "2", "About once a week" = "3", "A few times a week" = "4", "Almost everyday" = "5", "More than once per day" = "6"))
#Survey_PT$frequency_SM_usage <- revalue(Survey_PT$frequency_SM_usage, c("Never / not anymore" = "0"))
#Survey_PT$frequency_SM_usage <- as.factor(Survey_PT$frequency_SM_usage)
#Survey_PT$frequency_SM_usage <- as.numeric(Survey_PT$frequency_SM_usage)
#is.numeric(Survey_PT$frequency_SM_usage)

#Survey_PT <- Survey_PT[, c("familiarity_MT_num", "frequency_SM_usage_num")]

correlation <- cor(Survey_PT$familiarity_MT, Survey_PT$frequency_SM_usage, method = "spearman")
correlation

#df <- Survey_PT[, c("familiarity_MT", "frequency_SM_usage", "frequency_of_writing_in_other_language")]


cor_test_familiarity_MT <- cor.test(Survey_PT$familiarity_MT, Survey_PT$frequency_SM_usage, method = "pearson")
cor_test_familiarity_MT

cor_test_familiarity_MT_kendal <- cor.test(Survey_PT$familiarity_MT, Survey_PT$frequency_SM_usage, method = "kendall")
cor_test_familiarity_MT_kendal

survey_PT_new <- head(survey_PT, -3)
survey_PT_new$familiarity_MT <- factor(survey_PT_new$familiarity_MT, levels = c("I have never heard of it before", "I have heard of it but I am not familiar with it", "I am somewhat familiar with it", "I am very familiar with it"))
survey_PT_new$frequency_SM_usage <- factor(survey_PT_new$frequency_SM_usage, levels = c("Never / not anymore", "Less than once a month", "A few times a month", "About once a week", "A few times a week", "Almost everyday", "More than once per day"))
mapping_frequency_SM_usage <- c("Never / not anymore" = 0, "Less than once a month" = 1, "A few times a month" = 2, "About once a week" = 3, "A few times a week" = 4, "Almost everyday" = 5, "More than once per day" = 6)
mapping_frequency_SM_usage <- c("Never / not anymore" = "Never / not anymore", "Less than once a month" = "Less than once a month", "A few times a month" = "A few times a month", "About once a week" = "About once a week", "A few times a week" = "A few times a week", "Almost everyday" = "Almost everyday", "More than once per day" = "More than once per day")

survey_PT_new$frequency_SM_usage <- mapping_frequency_SM_usage[survey_PT_new$frequency_SM_usage]

boxplot_familiarity_MT_frequency_SM_usage <- ggplot(survey_PT, aes(familiarity_MT, frequency_SM_usage))
boxplot_familiarity_MT_frequency_SM_usage <- ggplot(survey_PT, aes(jitter(frequency_SM_usage), familiarity_MT))
boxplot_familiarity_MT_frequency_SM_usage + stat_boxplot() + labs(x = "Familiarity with MT", y = "Frequency of SM Usage")

boxplot_familiarity_MT_frequency_SM_usage + stat_boxplot() + labs(x = "Familiarity with MT", y = "Frequency of SM Usage")
#boxplot(survey_data_new$familiarity_MT ~ survey_data_new$frequency_SM_usage)

scatter_familiarity_MT_frequency_SM_usage <- ggplot(survey_data_new, aes(jitter(familiarity_MT), frequency_SM_usage))
scatter_familiarity_MT_frequency_SM_usage + geom_point() + geom_smooth(method ="lm", formula = y ~ x, color = "blue", alpha = 0.1, fill = "white") + labs(x = "Familiarity with MT", y = "Frequency of SM Usage")
boxplot_familiarity_MT_frequency_SM_usage <- ggplot(Survey_PT, aes(frequency_SM_usage, familiarity_MT))

mapping_read_MT. <- c("No" = 0, "Yes" = 1, "I am not sure" = NA_real_)
Survey_PT$read_MT. <- mapping_read_MT.[Survey_PT$read_MT.]
levels(Survey_PT$read_MT.)
#Survey_PT$read_MT. <- as.numeric(Survey_PT$read_MT.)
#is.numeric(Survey_PT$read_MT.)
cor_test_read_MT <- cor.test(Survey_PT$read_MT., Survey_PT$frequency_SM_usage, method = "pearson")
cor_test_read_MT

cor_test_read_MT_kendal <- cor.test(Survey_PT$read_MT., Survey_PT$frequency_SM_usage, method = "kendall")
cor_test_read_MT_kendal

ttest <- t.test(Survey_PT$frequency_SM_usage ~ Survey_PT$read_MT.)
ttest

scatter_read_MT_frequency_SM_usage <- ggplot(Survey_PT, aes(read_MT., frequency_SM_usage))
scatter_read_MT_frequency_SM_usage + geom_point() + geom_smooth(method ="lm", formula = y ~ x, color = "blue", alpha = 0.1, fill = "white") + labs(x = "Read MT before", y = "Frequency of Social Media Usage")

mapping_frequency_of_writing_in_other_language <- c("Never" = 0, "Rarely" = 1, "Sometimes" = 2, "Very often" = 3, "Always" = 4)
Survey_PT$frequency_of_writing_in_other_language <- mapping_frequency_of_writing_in_other_language[Survey_PT$frequency_of_writing_in_other_language]
#is.numeric(Survey_PT$frequency_of_writing_in_other_language)
#na.action(na.omit(c(Survey_PT$frequency_of_writing_in_other_language, NA)))
cor_test_1 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$frequency_of_writing_in_other_language, method = "pearson")
cor_test_1

res = apply(Survey_PT$frequency_of_writing_in_other_language,2,function(i){
  compl = !is.na(Survey_PT$familiarity_MT) & !is.na(i)
  unlist(cor.test(Survey_PT$familiarity_MT[compl],i[compl],method="pearson")[c("estimate","p.value")])})
res = t(res)
tail(res)
#Survey_PT$frequency_of_writing_in_other_language <- revalue(Survey_PT$frequency_of_writing_in_other_language, c("Never" = "0", "Rarely" = "1", "Sometimes" = "2", "Very often" = "3", "Always" = "4"))
#Survey_PT$frequency_of_writing_in_other_language <- as.numeric(Survey_PT$frequency_of_writing_in_other_language)


cor_test_4 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$frequency_of_writing_in_other_language, method = "kendall")
cor_test_4

cor_test2 <- cor.test(Survey_PT$read_MT., Survey_PT$frequency_of_writing_in_other_language, method = "pearson")
cor_test2

cor_test3 <- cor.test(Survey_PT$read_MT., Survey_PT$frequency_of_writing_in_other_language, method = "kendall")
cor_test3

ttest_1 <- t.test(Survey_PT$frequency_of_writing_in_other_language ~ Survey_PT$read_MT.)
ttest_1


scatter_familiarity_MT_frequency_of_writing_in_other_language <- ggplot(Survey_PT, aes(familiarity_MT, frequency_of_writing_in_other_language))
scatter_familiarity_MT_frequency_of_writing_in_other_language + geom_point() + geom_smooth(method ="lm", formula = y ~ x, color = "blue", alpha = 0.1, fill = "white") + labs(x = "Familiarity with MT", y = "Frequency_of_writing_in_other_language")

scatter_familiarity_MT_frequency_of_writing_in_other_language <- ggplot(Survey_PT, aes(read_MT., frequency_of_writing_in_other_language))
scatter_familiarity_MT_frequency_of_writing_in_other_language + geom_point() + geom_smooth(method ="lm", formula = y ~ x, color = "blue", alpha = 0.1, fill = "white") + labs(x = "Read MT before", y = "Frequency_of_writing_in_other_language")


mapping_quality_MT_posts <- c("Very poor" = -2, "Poor" = -1, "Neutral" = 0, "Good" = 1, "Very good" = 2)
Survey_PT$quality_MT_posts <- mapping_quality_MT_posts[Survey_PT$quality_MT_posts]
#Survey_PT$quality_MT_posts <- as.factor(Survey_PT$quality_MT_posts)
#Survey_PT$quality_MT_posts <- as.numeric(Survey_PT$quality_MT_posts)

#ggplot(Survey_PT, aes(quality_MT_posts)) + geom_histogram(aes(y=..density..), binwidth=1, color="black", fill="white") + stat_function(fun = dnorm, args =list(mean = mean(Survey_PT$quality_MT_posts), sd = sd(Survey_PT$quality_MT_posts)))
scatter_quality_frequency_SM_usage <- ggplot(Survey_PT, aes(quality_MT_posts, frequency_SM_usage))
scatter_quality_frequency_SM_usage + geom_point() + geom_smooth(method ="lm", formula = y ~ x, color = "blue", alpha = 0.1, fill = "white") + labs(x = "Quality of MT", y = "Frequency_SM_Usage")


cor_test_5 <- cor.test(Survey_PT$frequency_SM_usage, Survey_PT$quality_MT_posts, method = "kendall")
cor_test_5

cor_test_6 <- cor.test(Survey_PT$frequency_SM_usage, Survey_PT$quality_MT_posts, method = "pearson")
cor_test_6

cor_test_6 <- cor.test(Survey_PT$quality_MT_posts, Survey_PT$frequency_SM_usage, method = "pearson")
cor_test_6

model_1 <- aov(Survey_PT$frequency_SM_usage ~ Survey_PT$quality_MT_posts)
summary(model_1)

cor_test_7 <- cor.test(Survey_PT$frequency_of_writing_in_other_language, Survey_PT$quality_MT_posts, method = "kendall")
cor_test_7

cor_test_8 <- cor.test(Survey_PT$frequency_of_writing_in_other_language, Survey_PT$quality_MT_posts, method = "pearson")
cor_test_8

model_2 <- aov(Survey_PT$frequency_of_writing_in_other_language ~ Survey_PT$quality_MT_posts)
summary(model_2)

mapping_accuracy <- c("Extremely inaccurate" = -3, "Inaccurate" = -2, "Slightly inaccurate" = -1, "Neutral" = 0, "Slightly accurate" = 1, "Accurate" = 2, "Extremely accurate" = 3)
Survey_PT$accuracy_MT_actualMeaning <- mapping_accuracy[Survey_PT$accuracy_MT_actualMeaning]
#Survey_PT$accuracy_MT_actualMeaning <- as.factor(Survey_PT$accuracy_MT_actualMeaning)
#Survey_PT$accuracy_MT_actualMeaning <- as.numeric(Survey_PT$accuracy_MT_actualMeaning)

survey_PT_new$accuracy_MT_actualMeaning <- factor(survey_PT_new$accuracy_MT_actualMeaning, levels = c("Extremely inaccurate", "Inaccurate", "Slightly inaccurate", "Neutral", "Slightly accurate", "Accurate", "Extremely accurate"))
survey_PT_new <- survey_PT_new[!is.na(survey_PT_new$accuracy_MT_actualMeaning),]
scatter_accuracy_frequency_SM_usage <- ggplot(survey_PT_new, aes(jitter(frequency_SM_usage), accuracy_MT_actualMeaning))

scatter_accuracy_frequency_SM_usage_jitter <- ggplot(Survey_PT, aes(jitter(accuracy_MT_actualMeaning), frequency_SM_usage))
scatter_accuracy_frequency_SM_usage <- ggplot(survey_PT_new, aes(accuracy_MT_actualMeaning, frequency_SM_usage))
scatter_accuracy_frequency_SM_usage_jitter + geom_point() + geom_smooth(method ="lm", formula = y ~ x, color = "blue", alpha = 0.1, fill = "white") + labs(x = "Accuracy_MT_actualMeaning", y = "Frequency_SM_Usage")
scatter_accuracy_frequency_SM_usage + geom_boxplot() + labs(x = "Frequency_SM_Usage", y = "Accuracy_MT_actualMeaning")
scatter_accuracy_frequency_SM_usage + geom_boxplot() + labs(x = "Accuracy_MT_actualMeaning", y = "Frequency_SM_Usage")
cor_test_8 <- cor.test(Survey_PT$frequency_SM_usage, Survey_PT$accuracy_MT_actualMeaning, method = "kendall")
cor_test_8

cor_test_9 <- cor.test(Survey_PT$frequency_SM_usage, Survey_PT$accuracy_MT_actualMeaning, method = "pearson")
cor_test_9

model_3 <- aov(Survey_PT$frequency_SM_usage ~ Survey_PT$accuracy_MT_actualMeaning)
summary(model_3)

scatter_accuracy_frequency_writing_in_other_language <- ggplot(Survey_PT, aes(accuracy_MT_actualMeaning, frequency_of_writing_in_other_language))
scatter_accuracy_frequency_writing_in_other_language + geom_point() + geom_smooth(method ="lm", formula = y ~ x, color = "blue", alpha = 0.1, fill = "white") + labs(x = "Accuracy_MT_actualMeaning", y = "Frequency of Writing in Other Language")


cor_test_10 <- cor.test(Survey_PT$frequency_of_writing_in_other_language, Survey_PT$accuracy_MT_actualMeaning, method = "kendall")
cor_test_10

cor_test_11 <- cor.test(Survey_PT$frequency_of_writing_in_other_language, Survey_PT$accuracy_MT_actualMeaning, method = "pearson")
cor_test_11

model_4 <- aov(Survey_PT$frequency_of_writing_in_other_language ~ Survey_PT$accuracy_MT_actualMeaning)
summary(model_4)

ttest <- t.test(Survey_PT$accuracy_MT_actualMeaning ~ Survey_PT$read_MT.)
ttest


Survey_PT$accuracy_MT_connotativeMeaning <- mapping_accuracy[Survey_PT$accuracy_MT_connotativeMeaning] 
#Survey_PT$accuracy_MT_connotativeMeaning <- as.factor(Survey_PT$accuracy_MT_connotativeMeaning)
#Survey_PT$accuracy_MT_connotativeMeaning <- as.numeric(Survey_PT$accuracy_MT_connotativeMeaning)

cor_test_12 <- cor.test(Survey_PT$frequency_SM_usage, Survey_PT$accuracy_MT_connotativeMeaning, method = "pearson")
cor_test_12

cor_test_13 <- cor.test(Survey_PT$frequency_SM_usage, Survey_PT$accuracy_MT_connotativeMeaning, method = "kendall")
cor_test_13

ttest <- t.test(Survey_PT$accuracy_MT_connotativeMeaning ~ Survey_PT$read_MT.)
ttest

model_5 <- aov(Survey_PT$frequency_SM_usage ~ Survey_PT$accuracy_MT_connotativeMeaning)
summary(model_5)

cor_test_14 <- cor.test(Survey_PT$accuracy_MT_connotativeMeaning, Survey_PT$frequency_of_writing_in_other_language, method = "kendall")
cor_test_14

cor_test_15 <- cor.test(Survey_PT$accuracy_MT_connotativeMeaning, Survey_PT$frequency_of_writing_in_other_language, method = "pearson")
cor_test_15

model_6 <- aov(Survey_PT$frequency_of_writing_in_other_language ~ Survey_PT$accuracy_MT_connotativeMeaning)
summary(model_6)

table(Survey_PT$familiarity_MT, Survey_PT$frequency_SM_usage)

scatter_familiarity_frequency_writing_about_topics <- ggplot(Survey_PT, aes(familiarity_MT, topic_SM_post..Politics))
scatter_familiarity_frequency_writing_about_topics + geom_point() + geom_smooth(method ="lm", formula = y ~ x, color = "blue", alpha = 0.1, fill = "white") + labs(x = "Familiarity_MT", y = "Frequency of Writing about Politics")


ggplot(Survey_PT, aes(Familiarity_MT, Politics, Religion, Your_personal_opinions, Health_issues, Mental_health_issues, Relationship_issues, Financial_problems, Problems_at_school_or_work, Posts_with_curse_words, Posts_made_in_anger)) + stat_summary(fun=mean, geom="bar", fill="white", color="black") + stat_summary(fun.data=mean_cl_normal,geom="errorbar", width=0.2)

familiarity_mapping <- c("I have never heard of it before" = 0, "I have heard of it but I am not familiar with it" = 1, "I am somewhat familiar with it" = 2, "I am very familiar with it" = 3)
Survey_PT$familiarity_MT <- familiarity_mapping[Survey_PT$familiarity_MT]

Survey_PT$read_MT. <- mapping_read_MT.[Survey_PT$read_MT.]

topics_mapping <- c("Never" = 0, "Rarely" = 1, "Sometimes" = 2, "Very often" = 3, "Always" = 4)
rename(Survey_PT, "topic_SM_post..Politics")
Survey_PT$Politics <- topics_mapping[Survey_PT$topic_SM_post..Politics]
Survey_PT$Religion <- topics_mapping[Survey_PT$topic_SM_post..Religion]
Survey_PT$Your_personal_opinions <- topics_mapping[Survey_PT$topic_SM_post..Your.personal.opinions]
Survey_PT$Health_issues <- topics_mapping[Survey_PT$topic_SM_post..Health.issues]
Survey_PT$Mental_health_issues <- topics_mapping[Survey_PT$topic_SM_post..Mental.health.issues]
Survey_PT$Financial_problems <- topics_mapping[Survey_PT$topic_SM_post..Financial.problems]
Survey_PT$Relationship_issues <- topics_mapping[Survey_PT$topic_SM_post..Relationship.issues]
Survey_PT$Problems_at_school_or_work <- topics_mapping[Survey_PT$topic_SM_post..Problems.at.school.work]
Survey_PT$Posts_made_in_anger <- topics_mapping[Survey_PT$topic_SM_post..Posts.made.in.anger]
Survey_PT$Posts_with_curse_words <- topics_mapping[Survey_PT$topic_SM_post..Posts.with.curse.words]

ggplot(Survey_PT, aes(Familiarity_MT, Politics, Religion, Your_personal_opinions, Health_issues, Mental_health_issues, Relationship_issues, Financial_problems, Problems_at_school_or_work, Posts_with_curse_words, Posts_made_in_anger)) + stat_summary(fun=mean, geom="bar", fill="white", color="black") + stat_summary(fun.data=mean_cl_normal,geom="errorbar", width=0.2)

cor_test_16 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Politics, method = "pearson")
cor_test_16

cor_test_17 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Politics, method = "kendall")
cor_test_17

cor_test_16 <- cor.test(Survey_PT$read_MT., Survey_PT$Politics, method = "pearson")
cor_test_16

cor_test_17 <- cor.test(Survey_PT$read_MT., Survey_PT$Politics, method = "kendall")
cor_test_17

ttest <- t.test(Survey_PT$Politics~ Survey_PT$read_MT.)
ttest

model_1 <- lm(Politics ~ familiarity_MT, data = Survey_PT)
summary(model_1)

cor_test_18 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Religion, method = "pearson")
cor_test_18

cor_test_19 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Religion, method = "kendall")
cor_test_19

cor_test_18 <- cor.test(Survey_PT$read_MT., Survey_PT$Religion, method = "pearson")
cor_test_18

cor_test_19 <- cor.test(Survey_PT$read_MT., Survey_PT$Religion, method = "kendall")
cor_test_19

ttest <- t.test(Survey_PT$Religion~ Survey_PT$read_MT.)
ttest

model_2 <- lm(Religion ~ familiarity_MT, data = Survey_PT)
summary(model_2)

cor_test_20 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Health_issues, method = "pearson")
cor_test_20


cor_test_21 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Health_issues, method = "kendall")
cor_test_21

cor_test_20 <- cor.test(Survey_PT$read_MT., Survey_PT$Health_issues, method = "pearson")
cor_test_20

cor_test_21 <- cor.test(Survey_PT$read_MT., Survey_PT$Health_issues, method = "kendall")
cor_test_21

ttest <- t.test(Survey_PT$Health_issues~ Survey_PT$read_MT.)
ttest


model_3 <- lm(Health_issues ~ familiarity_MT, data = Survey_PT)
summary(model_3)

cor_test_22 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Mental_health_issues, method = "pearson")
cor_test_22

cor_test_23 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Mental_health_issues, method = "kendall")
cor_test_23

cor_test_22 <- cor.test(Survey_PT$read_MT., Survey_PT$Mental_health_issues, method = "pearson")
cor_test_22

cor_test_23 <- cor.test(Survey_PT$read_MT., Survey_PT$Mental_health_issues, method = "kendall")
cor_test_23

ttest <- t.test(Survey_PT$Mental_health_issues~ Survey_PT$read_MT.)
ttest

model_4 <- lm(Mental_health_issues ~ familiarity_MT, data = Survey_PT)
summary(model_4)


cor_test_22 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Relationship_issues, method = "pearson")
cor_test_22

cor_test_23 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Relationship_issues, method = "kendall")
cor_test_23

cor_test_22 <- cor.test(Survey_PT$read_MT., Survey_PT$Relationship_issues, method = "pearson")
cor_test_22

cor_test_23 <- cor.test(Survey_PT$read_MT., Survey_PT$Relationship_issues, method = "kendall")
cor_test_23

ttest <- t.test(Survey_PT$Relationship_issues~ Survey_PT$read_MT.)
ttest

model_4 <- lm(Relationship_issues ~ familiarity_MT, data = Survey_PT)
summary(model_4)

cor_test_24 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Financial_problems, method = "pearson")
cor_test_24

cor_test_25 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Financial_problems, method = "kendall")
cor_test_25

cor_test_24 <- cor.test(Survey_PT$read_MT., Survey_PT$Financial_problems, method = "pearson")
cor_test_24

cor_test_25 <- cor.test(Survey_PT$read_MT., Survey_PT$Financial_problems, method = "kendall")
cor_test_25

ttest <- t.test(Survey_PT$Financial_problems~ Survey_PT$read_MT.)
ttest

model_4 <- lm(Financial_problems ~ familiarity_MT, data = Survey_PT)
summary(model_4)

cor_test_26 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Your_personal_opinions, method = "pearson")
cor_test_26

cor_test_27 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Your_personal_opinions, method = "kendall")
cor_test_27

cor_test_26 <- cor.test(Survey_PT$read_MT., Survey_PT$Your_personal_opinions, method = "pearson")
cor_test_26

cor_test_27 <- cor.test(Survey_PT$read_MT., Survey_PT$Your_personal_opinions, method = "kendall")
cor_test_27

ttest <- t.test(Survey_PT$Your_personal_opinions~ Survey_PT$read_MT.)
ttest

model_4 <- lm(Your_personal_opinions ~ familiarity_MT, data = Survey_PT)
summary(model_4)

cor_test_26 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Problems_at_school_or_work, method = "pearson")
cor_test_26

cor_test_27 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Problems_at_school_or_work, method = "kendall")
cor_test_27

cor_test_26 <- cor.test(Survey_PT$read_MT., Survey_PT$Problems_at_school_or_work, method = "pearson")
cor_test_26

cor_test_27 <- cor.test(Survey_PT$read_MT., Survey_PT$Problems_at_school_or_work, method = "kendall")
cor_test_27

ttest <- t.test(Survey_PT$Problems_at_school_or_work~ Survey_PT$read_MT.)
ttest

model_4 <- lm(Problems_at_school_or_work ~ familiarity_MT, data = Survey_PT)
summary(model_4)

cor_test_26 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Posts_with_curse_words, method = "pearson")
cor_test_26

cor_test_27 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Posts_with_curse_words, method = "kendall")
cor_test_27

cor_test_26 <- cor.test(Survey_PT$read_MT., Survey_PT$Posts_with_curse_words, method = "pearson")
cor_test_26

cor_test_27 <- cor.test(Survey_PT$read_MT., Survey_PT$Posts_with_curse_words, method = "kendall")
cor_test_27

ttest <- t.test(Survey_PT$Posts_with_curse_words~ Survey_PT$read_MT.)
ttest

cor_test_26 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Posts_made_in_anger, method = "pearson")
cor_test_26

cor_test_27 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$Posts_made_in_anger, method = "kendall")
cor_test_27

cor_test_26 <- cor.test(Survey_PT$read_MT., Survey_PT$Posts_made_in_anger, method = "pearson")
cor_test_26

cor_test_27 <- cor.test(Survey_PT$read_MT., Survey_PT$Posts_made_in_anger, method = "kendall")
cor_test_27

ttest <- t.test(Survey_PT$Posts_made_in_anger~ Survey_PT$read_MT.)
ttest


SM_content <- c("Politics", "Religion", "Health_issues", "Your_personal_opinions", "Mental_health_issues", "Relationship_issues", "Financial_problems", "Problems_at_school_or_work", "Post_made_in_anger", "Posts_with_curse_words") 
scale <- c("Never", "Rarely", "Sometimes", "Very often", "always")
ggplot(Survey_PT, aes(fill=SM_content, y=frequency(SM_content), x=scale)) + geom_bar(position="stack", stat="identity")

mapping_usefullness_MT <- c("Completely useless" = -2, "Somewhat useless" = -1, "Neutral" = 0, "Somewhat useful" = 1, "Very useful" = 2)
Survey_PT$usefullness_MT_SM <- mapping_usefullness_MT[Survey_PT$usefullness_MT_SM]

mapping_worried_misused <- c("Not worried at all" = 0, "Somewhat worried" = 1, "Worried" = 2, "Very worried" = 3)
Survey_PT$worried_SP_misused.<- mapping_worried_misused[Survey_PT$worried_SP_misused.]

cor_test_26 <- cor.test(Survey_PT$read_MT., Survey_PT$usefullness_MT_SM, method = "pearson")
cor_test_26

cor_test_27 <- cor.test(Survey_PT$read_MT., Survey_PT$usefullness_MT_SM, method = "kendall")
cor_test_27

ttest_5 <- t.test(Survey_PT$usefullness_MT_SM ~ Survey_PT$read_MT.)
ttest_5

ttest_6 <- lm(Survey_PT$usefullness_MT_SM ~ as.factor(Survey_PT$read_MT.))
summary(ttest_6)

ggplot(Survey_PT, aes(as.factor(read_MT.), usefullness_MT_SM)) + geom_boxplot()

aggregate(usefullness_MT_SM ~ read_MT., data=Survey_PT, mean)
aggregate(usefullness_MT_SM ~ read_MT., data=Survey_PT, length)

ggplot(Survey_PT, aes(usefullness_MT_SM)) + stat_summary(fun=mean, geom="bar", fill="white", color="black") + stat_summary(fun.data=mean_cl_normal,geom="errorbar", width=0.2)

mapping_particular_audience <- c("No" = 0, "Yes" = 1, "I am not sure" = NA_real_)
Survey_PT$posts_written_for_particular_audience.<- mapping_particular_audience[Survey_PT$posts_written_for_particular_audience.]

ttest_5 <- t.test(Survey_PT$SM_post_other_language. ~ Survey_PT$posts_written_for_particular_audience.)
ttest_5

mapping_concerns <- c("Completely disagree" = -2, "Somewhat disagree" = -1, "Neutral" = 0, "Somewhat agree" = 1, "Completely agree" = 2)
Survey_PT$prefer_have_more_control_SM_posts_translation <- mapping_more_control[Survey_PT$prefer_have_more_control_SM_posts_translation]

Survey_PT$upset_if_SP_translated_from_original_language_to_English <- mapping_concerns[Survey_PT$upset_if_SP_translated_from_original_language_to_English]
Survey_PT$SP_translated_impact_professional_life <- mapping_concerns[Survey_PT$SP_translated_impact_professional_life]
Survey_PT$SP_translated_impact_personal_life <- mapping_concerns[Survey_PT$SP_translated_impact_personal_life]
Survey_PT$want_translated_everytime_post_SM <- mapping_concerns[Survey_PT$want_translated_everytime_post_SM]
Survey_PT$prefer_manually_translate_posts <- mapping_concerns[Survey_PT$prefer_manually_translate_posts]
Survey_PT$read_and_edit_MT_beforeSharing <- mapping_concerns[Survey_PT$read_and_edit_MT_beforeSharing]
Survey_PT$change_language_depending_on_topic <- mapping_frequency_of_writing_in_other_language[Survey_PT$change_language_depending_on_topic]


Survey_PT$not_wanted_post_translate_to_another_language. <- mapping_read_MT.[Survey_PT$not_wanted_post_translate_to_another_language.]
Survey_PT$SM_post_other_language.<- mapping_read_MT.[Survey_PT$SM_post_other_language.]

ttest_writing_other_language <- t.test(Survey_PT$SM_post_other_language. ~ Survey_PT$not_wanted_post_translate_to_another_language.)
ttest_writing_other_language


cor_test_26 <- cor.test(Survey_PT$read_MT., Survey_PT$usefullness_MT_SM, method = "pearson")
cor_test_26

cor_test_27 <- cor.test(Survey_PT$read_MT., Survey_PT$usefullness_MT_SM, method = "kendall")
cor_test_27

cor_test_26 <- cor.test(Survey_PT$SM_post_other_language., Survey_PT$worried_SP_misused., method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$SM_post_other_language., Survey_PT$worried_SP_misused., method = "kendall")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$frequency_SM_usage, Survey_PT$worried_SP_misused., method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$SM_post_other_language., Survey_PT$not_wanted_post_translate_to_another_language., method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$SM_post_other_language., Survey_PT$not_wanted_post_translate_to_another_language., method = "kendall")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$SM_post_other_language., Survey_PT$posts_written_for_particular_audience., method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$SM_post_other_language., Survey_PT$not_wanted_post_translate_to_another_language., method = "kendall")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$SM_post_other_language., Survey_PT$SP_translated_impact_professional_life, method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$SM_post_other_language., Survey_PT$SP_translated_impact_personal_life, method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$frequency_SM_usage, Survey_PT$prefer_have_more_control_SM_posts_translation, method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$frequency_SM_usage, Survey_PT$prefer_have_more_control_SM_posts_translation, method = "kendall")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$frequency_of_writing_in_other_language, Survey_PT$prefer_have_more_control_SM_posts_translation, method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$read_MT., Survey_PT$prefer_have_more_control_SM_posts_translation, method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$prefer_have_more_control_SM_posts_translation, method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$want_translated_everytime_post_SM, method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$familiarity_MT, Survey_PT$prefer_manually_translate_posts, method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$read_MT., Survey_PT$want_translated_everytime_post_SM, method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$read_MT., Survey_PT$prefer_manually_translate_posts, method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$read_MT., Survey_PT$read_and_edit_MT_beforeSharing, method = "pearson")
cor_test_26

cor_test_26 <- cor.test(Survey_PT$frequency_SM_usage, Survey_PT$read_and_edit_MT_beforeSharing, method = "pearson")
cor_test_26

Survey_PT$frequency_SM_usage <- mapping_frequency_SM_usage[Survey_PT$frequency_SM_usage]
cor_test_26 <- cor.test(Survey_PT$frequency_SM_usage, Survey_PT$change_language_depending_on_topic, method = "pearson")
cor_test_26

table(Survey_PT$read_MT.)
