Skip to content

Commit

Permalink
figure updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasgerstenberg committed Apr 3, 2024
1 parent 6bcf975 commit 59d2fb1
Show file tree
Hide file tree
Showing 6 changed files with 635 additions and 608 deletions.
33 changes: 21 additions & 12 deletions analysis/children_disagree.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,15 @@ l.color = list(agreement = "#89fa50",
### Read in data

```{r, message=FALSE}
# fixed rounding issue; one participant was actually 11 and turned 12 the next day
# participant reported they were 9 despite birth year indicating they were 8;
# recoded to 9.69 given reported age likely more reliable
df.exp1 = read_csv("../data/data1_infer.csv") %>%
rename(trial_order = trial_order_dada)
rename(trial_order = trial_order_dada) %>%
mutate(age_continuous = ifelse(age_continuous == 12, 11.99,
ifelse(age_continuous == 8.69, 9.69,
age_continuous)))
```

## STATS
Expand Down Expand Up @@ -222,8 +229,7 @@ df.plot.individual = df.exp1 %>%
df.age.means = df.plot.individual %>%
distinct(participant, age_continuous) %>%
mutate(age_continuous = ifelse(age_continuous == 12, 11.99, age_continuous),
age_group = floor(age_continuous)) %>%
mutate(age_group = floor(age_continuous)) %>%
group_by(age_group) %>%
summarize(age_mean = mean(age_continuous),
n = str_c("n = ", n())) %>%
Expand Down Expand Up @@ -410,7 +416,8 @@ results = fun.regression(
formula = "ambiguous_yes ~ 1 + condition_disagree + (1 | participant)",
data = df.exp2.infer)
prop.table(table(df.exp2.infer$condition_disagree, df.exp2.infer$ambiguous_yes), margin=1)
prop.table(table(df.exp2.infer$condition_disagree, df.exp2.infer$ambiguous_yes),
margin = 1)
fun.table(results, type = "confirmatory")
```
Expand Down Expand Up @@ -483,7 +490,8 @@ results = fun.regression(
formula = "ambiguous_yes ~ 1 + condition_disagree + (1 | participant)",
data = df.exp2.infer.7.1)
prop.table(table(df.exp2.infer.7.1$condition_disagree, df.exp2.infer.7.1$ambiguous_yes), margin=1)
prop.table(table(df.exp2.infer.7.1$condition_disagree, df.exp2.infer.7.1$ambiguous_yes),
margin = 1)
fun.table(results, type = "confirmatory")
Expand All @@ -496,7 +504,8 @@ results = fun.regression(
formula = "ambiguous_yes ~ 1 + condition_disagree + (1 | participant)",
data = df.exp2.infer.7.4)
prop.table(table(df.exp2.infer.7.4$condition_disagree, df.exp2.infer.7.4$ambiguous_yes), margin=1)
prop.table(table(df.exp2.infer.7.4$condition_disagree, df.exp2.infer.7.4$ambiguous_yes),
margin = 1)
fun.table(results, type = "confirmatory")
```
Expand Down Expand Up @@ -729,8 +738,7 @@ df.plot.individual = df.exp2.predict %>%
df.age.means = df.plot.individual %>%
distinct(participant, age_continuous) %>%
mutate(age_continuous = ifelse(age_continuous == 12, 11.99, age_continuous),
age_group = floor(age_continuous)) %>%
mutate(age_group = floor(age_continuous)) %>%
group_by(age_group) %>%
summarize(age_mean = mean(age_continuous),
n = str_c("n = ", n())) %>%
Expand Down Expand Up @@ -822,8 +830,7 @@ df.plot.individual = df.exp2.infer %>%
df.age.means = df.plot.individual %>%
distinct(participant, age_continuous) %>%
mutate(age_continuous = ifelse(age_continuous == 12, 11.99, age_continuous),
age_group = floor(age_continuous)) %>%
mutate(age_group = floor(age_continuous)) %>%
group_by(age_group) %>%
summarize(age_mean = mean(age_continuous),
n = str_c("n = ", n())) %>%
Expand Down Expand Up @@ -926,10 +933,12 @@ ggplot() +
axis.title.y = element_markdown(color = l.color$ambiguous),
legend.position = "right") +
guides(fill = guide_legend(override.aes = list(shape = 21,
size = 3),
size = 3,
alpha = 1),
reverse = T,
order = 1),
shape = guide_legend(override.aes = list(fill = "white", alpha = 1)),
shape = guide_legend(override.aes = list(fill = "white",
alpha = 1)),
color = "none")
ggsave(filename = "../figures/plots/exp2_inference.pdf",
Expand Down
Loading

0 comments on commit 59d2fb1

Please sign in to comment.