Skip to content

Commit

Permalink
eps plots
Browse files Browse the repository at this point in the history
  • Loading branch information
sabyasachee committed Sep 23, 2023
1 parent f4ab6c5 commit ca58724
Show file tree
Hide file tree
Showing 36 changed files with 491,688 additions and 12,471 deletions.
Binary file modified .RData
Binary file not shown.
746 changes: 373 additions & 373 deletions .Rhistory

Large diffs are not rendered by default.

14,720 changes: 14,200 additions & 520 deletions data/plots/age_trends.eps

Large diffs are not rendered by default.

8,662 changes: 6,653 additions & 2,009 deletions data/plots/age_x_lang_trends.eps

Large diffs are not rendered by default.

43,932 changes: 42,452 additions & 1,480 deletions data/plots/age_x_skintone_trends.eps

Large diffs are not rendered by default.

Binary file modified data/plots/derogatory_trend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/plots/derogatory_x_lang_trend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14,417 changes: 14,417 additions & 0 deletions data/plots/eps/age_trends.eps

Large diffs are not rendered by default.

7,077 changes: 7,077 additions & 0 deletions data/plots/eps/age_x_lang_trends.eps

Large diffs are not rendered by default.

42,668 changes: 42,668 additions & 0 deletions data/plots/eps/age_x_skintone_trends.eps

Large diffs are not rendered by default.

1,435 changes: 1,435 additions & 0 deletions data/plots/eps/derogatory_trend.eps

Large diffs are not rendered by default.

1,981 changes: 1,981 additions & 0 deletions data/plots/eps/derogatory_x_lang_trend.eps

Large diffs are not rendered by default.

7,359 changes: 7,359 additions & 0 deletions data/plots/eps/gender_trends.eps

Large diffs are not rendered by default.

28,517 changes: 28,517 additions & 0 deletions data/plots/eps/gender_x_age_trends.eps

Large diffs are not rendered by default.

85,079 changes: 85,079 additions & 0 deletions data/plots/eps/gender_x_age_x_skintone_trends.eps

Large diffs are not rendered by default.

3,725 changes: 3,725 additions & 0 deletions data/plots/eps/gender_x_lang_trends.eps

Large diffs are not rendered by default.

21,485 changes: 21,485 additions & 0 deletions data/plots/eps/gender_x_skintone_trends.eps

Large diffs are not rendered by default.

6,981 changes: 6,981 additions & 0 deletions data/plots/eps/gendername_trend.eps

Large diffs are not rendered by default.

8,111 changes: 8,111 additions & 0 deletions data/plots/eps/gendername_x_lang_trend.eps

Large diffs are not rendered by default.

10,321 changes: 10,321 additions & 0 deletions data/plots/eps/religion_trend.eps

Large diffs are not rendered by default.

11,767 changes: 11,767 additions & 0 deletions data/plots/eps/religion_x_lang_trend.eps

Large diffs are not rendered by default.

10,888 changes: 10,888 additions & 0 deletions data/plots/eps/skintone_trends.eps

Large diffs are not rendered by default.

5,410 changes: 5,410 additions & 0 deletions data/plots/eps/skintone_x_lang_trends.eps

Large diffs are not rendered by default.

7,498 changes: 7,170 additions & 328 deletions data/plots/gender_trends.eps

Large diffs are not rendered by default.

29,248 changes: 28,288 additions & 960 deletions data/plots/gender_x_age_trends.eps

Large diffs are not rendered by default.

87,732 changes: 84,826 additions & 2,906 deletions data/plots/gender_x_age_x_skintone_trends.eps

Large diffs are not rendered by default.

4,508 changes: 3,425 additions & 1,083 deletions data/plots/gender_x_lang_trends.eps

Large diffs are not rendered by default.

22,058 changes: 21,278 additions & 780 deletions data/plots/gender_x_skintone_trends.eps

Large diffs are not rendered by default.

Binary file modified data/plots/gendername_trend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/plots/gendername_x_lang_trend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/plots/religion_trend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/plots/religion_x_lang_trend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11,109 changes: 10,685 additions & 424 deletions data/plots/skintone_trends.eps

Large diffs are not rendered by default.

6,603 changes: 5,048 additions & 1,555 deletions data/plots/skintone_x_lang_trends.eps

Large diffs are not rendered by default.

42 changes: 23 additions & 19 deletions language.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# set up ----------------------------------------------------------------------
## load libraries ----
# load libraries ----
library(lme4)
library(lmerTest)
library(emmeans)
Expand All @@ -8,24 +7,23 @@ library(Kendall)

emm_options(pbkrtest.limit = 28776, lmertest.limit = 28776)

## read data ----
## read long-form data (created and cleaned by @Sabyasachee)
# read data ----
lang_data <- read.csv("data/wide_lang.csv")
lang_religion_data <- read.csv("data/long_lang_religion.csv")
lang_gender_data <- read.csv("data/long_lang_gender.csv")

# derogatory
## derogatory ----
lang_data$derogatory_per <- 100 * lang_data$derogatory / lang_data$transcript
lang_data$derogatory_nonstop_per <-
100 * lang_data$derogatory / lang_data$non_stopword_transcript

# religion
## religion ----
lang_religion_data$name_count_per <-
100 * lang_religion_data$name_count / lang_religion_data$transcript
lang_religion_data$name_count_nonstop_per <-
100 * lang_religion_data$name_count / lang_religion_data$non_stopword_transcript

# gender
## gender ----
lang_gender_data$name_count_per <-
100 * lang_gender_data$name_count / lang_gender_data$transcript
lang_gender_data$name_count_nonstop_per <-
Expand All @@ -45,62 +43,68 @@ m_religion <- lmer(name_count_per ~ religion * year
+ (1|program) + (1|lang) + (1|genre), lang_religion_data)
m_religion_x_lang <- lmer(name_count_per ~ religion * lang * year
+ (1|program) + (1|genre), lang_religion_data)
religion_trends <- emtrends(m_religion, ~religion, var = "year")
religion_x_lang_trends <- emtrends(m_religion_x_lang, ~lang + religion, var = "year") %>%
as_tibble() %>% arrange(lang, religion)

# gendered person names
m_gendername <- lmer(name_count_per ~ gender * year
+ (1|program) + (1|lang) + (1|genre), lang_gender_data)
m_gendername_x_lang <- lmer(name_count_per ~ gender * lang * year
+ (1|program) + (1|genre), lang_gender_data)
gendername_trends <- emtrends(m_gendername, ~gender, var = "year")
gendername_x_lang_trends <- emtrends(m_gendername_x_lang, ~lang + gender, var = "year") %>%
as_tibble() %>% arrange(lang, gender)

## plots ---
# derogatory words
ggplot(lang_data, aes(x = year, y = derogatory_per)) +
# geom_point(alpha = 0.5) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
theme_minimal() +
labs(y = "Percentage of Derogatory Words")
ggsave("data/derogatory_trend.eps", device = "eps")
ggsave("data/plots/derogatory_trend.png", device = "png")

ggplot(lang_data, aes(x = year, y = derogatory_per, group = lang,
color = lang)) +
# geom_point(alpha = 0.5) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
theme_minimal() +
labs(y = "Percentage of Derogatory Words")
ggsave("data/derogatory_x_lang_trend.eps", device = "eps")
ggsave("data/plots/derogatory_x_lang_trend.png", device = "png")

# religion person names
ggplot(lang_religion_data, aes(x = year, y = name_count_per,
group = religion, color = religion)) +
# geom_point(alpha = 0.5) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
theme_minimal() +
labs(y = "Percentage of person names of different religions")
ggsave("data/religion_trend.eps", device = "eps")
ggsave("data/plots/religion_trend.png", device = "png")

ggplot(lang_religion_data, aes(x = year, y = name_count_per,
group = religion, color = religion)) +
# geom_point(alpha = 0.5) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
theme_minimal() +
labs(y = "Percentage of person names of different religions") +
facet_wrap(~lang)
ggsave("data/religion_x_lang_trend.eps", device = "eps")
ggsave("data/plots/religion_x_lang_trend.png", device = "png")

# gender person names
ggplot(lang_gender_data, aes(x = year, y = name_count_per,
group = gender, color = gender)) +
# geom_point(alpha = 0.5) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
theme_minimal() +
labs(y = "Percentage of person names of different genders")
ggsave("data/gendername_trend.eps", device = "eps")
ggsave("data/plots/gendername_trend.png", device = "png")

ggplot(lang_gender_data, aes(x = year, y = name_count_per,
group = gender, color = gender)) +
# geom_point(alpha = 0.5) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
theme_minimal() +
labs(y = "Percentage of person names of different genders") +
facet_wrap(~lang)
ggsave("data/gendername_x_lang_trend.eps", device = "eps")
ggsave("data/plots/gendername_x_lang_trend.png", device = "png")
Loading

0 comments on commit ca58724

Please sign in to comment.