This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Cmd+Shift+Enter.
library(tidyverse)
anjie_d <- read.csv("/Users/caoanjie/Desktop/Summer2020/cross-cultural/picture_description/pilot-data - anjie-coding.csv")
anjie_d %>%
DT::datatable()
shan_d <- read.csv("/Users/caoanjie/Desktop/Summer2020/cross-cultural/picture_description/pilot-data - shan-coding.csv")
shan_d <- shan_d %>%
select(Coder, Participant, Language.Background, Language.Used, presentation_mode, item_number, raw_text, coding_item, position, score, note)
anjie_d %>%
filter(!is.na(score)) %>%
mutate(Language_Background = Language.Background,
Language_Used = Language.Used) %>%
group_by(coding_item, position, Language_Background) %>%
summarise(
mean = mean(score),
sd = sd(score),
n = n()) %>%
mutate(ci_range_95 = 1.96 * (sd/sqrt(n)),
ci_lower = mean - ci_range_95,
ci_upper = mean + ci_range_95) -> summary_anjie_d_lb
summary_anjie_d_lb %>%
ggplot(aes(x = coding_item, y = mean, fill = position)) +
geom_col(position = "dodge") +
geom_errorbar(aes(ymin = ci_lower, ymax = ci_upper),
position=position_dodge(.9),
width=.2) +
theme(axis.text.x = element_text(angle = 90))+
facet_wrap(~Language_Background)
anjie_d %>%
filter(!is.na(score)) %>%
mutate(Language_Background = Language.Background,
Language_Used = Language.Used) %>%
group_by(coding_item, position, Language_Used) %>%
summarise(
mean = mean(score),
sd = sd(score),
n = n()) %>%
mutate(ci_range_95 = 1.96 * (sd/sqrt(n)),
ci_lower = mean - ci_range_95,
ci_upper = mean + ci_range_95) -> summary_anjie_d_lu
summary_anjie_d_lu %>%
ggplot(aes(x = coding_item, y = mean, fill = position)) +
geom_col(position = "dodge") +
geom_errorbar(aes(ymin = ci_lower, ymax = ci_upper),
position=position_dodge(.9),
width=.2) +
theme(axis.text.x = element_text(angle = 90))+
facet_wrap(~Language_Used)
NA
NA
shan_d %>%
filter(!is.na(score)) %>%
mutate(Language_Background = Language.Background,
Language_Used = Language.Used) %>%
group_by(coding_item, position) %>%
summarise(
mean = mean(score),
sd = sd(score),
n = n()) %>%
mutate(ci_range_95 = 1.96 * (sd/sqrt(n)),
ci_lower = mean - ci_range_95,
ci_upper = mean + ci_range_95) -> summary_shan_d
summary_shan_d
coding_item <fctr> | position <fctr> | mean <dbl> | sd <dbl> | n <int> | ci_range_95 <dbl> | ci_lower <dbl> | ci_upper <dbl> |
---|---|---|---|---|---|---|---|
descriptive_account | background | 1.300000 | 1.3243286 | 40 | 0.4104137 | 0.8895863 | 1.710414 |
descriptive_account | focal | 2.125000 | 1.2022948 | 40 | 0.3725950 | 1.7524050 | 2.497595 |
first_mention_object | background | 1.897436 | 1.1875422 | 39 | 0.3727115 | 1.5247244 | 2.270147 |
first_mention_object | focal | 1.125000 | 0.3349321 | 40 | 0.1037965 | 1.0212035 | 1.228797 |
relational_account | background | 1.512821 | 1.0481009 | 39 | 0.3289477 | 1.1838728 | 1.841768 |
relational_account | focal | 1.128205 | 0.6561245 | 39 | 0.2059254 | 0.9222797 | 1.334131 |
summary_shan_d %>%
ggplot(aes(x = coding_item, y = mean, fill = position)) +
geom_col(position = "dodge") +
geom_errorbar(aes(ymin = ci_lower, ymax = ci_upper),
position=position_dodge(.9),
width=.2) +
theme(axis.text.x = element_text(angle = 90)) +
ggtitle("shan's coding, Chinese only")
NA
NA
NA
anjie_d_clean <- anjie_d %>%
select(Coder, Participant, Language.Background, Language.Used, presentation_mode, item_number, raw_text, coding_item, position, score, note)
shan_d_clean <- shan_d %>%
select(Coder, Participant, Language.Background, Language.Used, presentation_mode, item_number, raw_text, coding_item, position, score, note)
both_coding <- bind_rows(anjie_d_clean, shan_d_clean)
Unequal factor levels: coercing to characterbinding character and factor vector, coercing into character vectorbinding character and factor vector, coercing into character vectorUnequal factor levels: coercing to characterbinding character and factor vector, coercing into character vectorbinding character and factor vector, coercing into character vectorUnequal factor levels: coercing to characterbinding character and factor vector, coercing into character vectorbinding character and factor vector, coercing into character vectorUnequal factor levels: coercing to characterbinding character and factor vector, coercing into character vectorbinding character and factor vector, coercing into character vectorUnequal factor levels: coercing to characterbinding character and factor vector, coercing into character vectorbinding character and factor vector, coercing into character vector
both_coding
Coder <chr> | Participant <int> | Language.Background <chr> | Language.Used <chr> | presentation_mode <fctr> | item_number <fctr> | |
---|---|---|---|---|---|---|
anjie | 1 | Chinese | Chinese | phone | item_1 | |
anjie | 1 | Chinese | Chinese | phone | item_1 | |
anjie | 1 | Chinese | Chinese | phone | item_1 | |
anjie | 1 | Chinese | Chinese | phone | item_1 | |
anjie | 1 | Chinese | Chinese | phone | item_1 | |
anjie | 1 | Chinese | Chinese | phone | item_1 | |
anjie | 1 | Chinese | Chinese | phone | item_2 | |
anjie | 1 | Chinese | Chinese | phone | item_2 | |
anjie | 1 | Chinese | Chinese | phone | item_2 | |
anjie | 1 | Chinese | Chinese | phone | item_2 |
both_coding %>%
group_by(position) %>%
mutate(position_num = row_number()) %>% # create unique identifier to deal with duplicates
select(Coder, Participant, item_number, Language.Used, position, coding_item, score,position_num) %>%
pivot_wider(names_from = position, values_from = score) %>%
drop_na() %>%
select(-position_num) %>%
mutate(sensitivity_score = background-focal) %>%
group_by(Coder, Participant, Language.Used) %>%
summarize(
sum_ss = sum(sensitivity_score)
) -> summary_both_coding
summary_both_coding
Coder <chr> | Participant <int> | Language.Used <chr> | sum_ss <int> | |
---|---|---|---|---|
anjie | 1 | Chinese | -6 | |
anjie | 2 | Chinese | -14 | |
anjie | 3 | Chinese | -38 | |
anjie | 4 | English | -16 | |
anjie | 5 | English | 9 | |
anjie | 6 | English | 10 | |
shan | 1 | Chinese | 14 | |
shan | 2 | Chinese | 22 | |
shan | 3 | Chinese | -24 |
summary_both_coding %>%
ggplot(aes(x = as.factor(Participant), y = sum_ss, fill = Language.Used)) +
geom_col(position = "dodge") +
ggtitle("Calculated Sensitivity Score by participant") +
facet_wrap(~Coder)
NA