-
Notifications
You must be signed in to change notification settings - Fork 0
/
exp3_analysis_supplementary.Rmd
322 lines (264 loc) · 8.88 KB
/
exp3_analysis_supplementary.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
---
title: 'Experiment 3: Supplementary Analyses'
date: "`r Sys.Date()`"
output:
github_document:
toc: true
toc_depth: 3
pdf_document:
toc: true
toc_depth: 3
editor_options:
markdown:
wrap: 72
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
options(dplyr.summarise.inform = FALSE)
library(magrittr)
library(lme4)
library(lmerTest)
library(buildmer)
library(kableExtra)
library(ggtext)
library(broom.mixed)
```
# Setup
Variable names:
- Experiment: exp3\_
- Data (\_d\_)
- d = main df
- Models (\_m\_)
- FF = dummy coded with First + Full Name conditions as 0, Last
Name condition as 1
- L = dummy coded with Last Name condition as 0, First + Full Name
conditions as 1
- quad = quadratic effect of Name Gender
- subjGender = participant gender
- recenter= center name gender rating by scale (at 4)
- Plots (\_p\_)
Load data and select columns used in model. See data/exp3_data_about.txt
for more details.
```{r load-data}
exp3_d <- read.csv("../data/exp3_data.csv", stringsAsFactors = TRUE) %>%
rename("Participant" = "SubjID", "Item" = "Name") %>%
select(
Participant, SubjGenderMale, Condition,
GenderRating, Item, He, She, Other
)
str(exp3_d)
```
Center gender rating for names: Original scale from 1 to 7, with 1 as
most masculine and 7 as most feminine. Mean-centered with higher still
as more feminine.
```{r center-gender-rating}
exp3_d %<>% mutate(GenderRatingCentered = scale(GenderRating, scale = FALSE))
```
Set contrasts for name conditions. This uses Scott Fraundorf's function
for weighted contrasts. (The psycholing package version doesn't support
doing 2v1 comparisons, only 1v1.) Condition1 is Last vs First+Full.
Condition2 is First vs Full.
```{r contrast-coding}
source("centerfactor.R")
contrasts(exp3_d$Condition) <- centerfactor(
exp3_d$Condition, c("last", "first")
)
contrasts(exp3_d$Condition)
```
# Quadratic Name Gender Rating
The second supplementary analysis tested the quadratic effect of name
gender rating, such that larger values meant names with stronger gender
associations (masc or fem), and smaller values meant names with weaker
gender associations.
```{r squared-gender-rating}
exp3_d %<>% mutate(GenderRatingSquared = GenderRatingCentered^2)
```
## Model
Quadratic name gender effect on the likelihood of *she* responses, as
opposed to *he* and *other* responses. The maximal model includes random
intercepts by item, but not by participant.
```{r model-quad}
exp3_m_quad <- buildmer(
formula = She ~ Condition * GenderRatingCentered +
Condition * GenderRatingSquared +
(1 | Participant) + (1 | Item),
data = exp3_d, family = binomial,
buildmerControl(direction = "order", quiet = TRUE)
)
summary(exp3_m_quad)
```
## Main quadratic effect
To make this easier to understand, plot the data converted to log odds.
This includes just what the model is testing: *she* responses, no
effects of Condition included yet.
```{r plot-quad-main, warning=FALSE}
exp3_p_log <- exp3_d %>%
group_by(GenderRatingCentered, Item) %>%
summarise(She.Mean = mean(She)) %>%
mutate(She.Log = log(She.Mean)) %>%
ggplot(aes(x = GenderRatingCentered, y = She.Log)) +
geom_smooth(fill = "red", color = "red") +
geom_point(fill = "red", color = "red") +
theme_classic() +
labs(
title = "Experiment 3: Log Odds of *She* Responses",
x = "Masculine - Feminine",
y = "Log Odds (Item Means)"
) +
theme(
text = element_text(size = 16),
plot.title = element_markdown()
)
exp3_p_log
```
At the masculine end of the scale, *she* responses decrease more
linearly. At the feminine end of the scale, *she* responses level off at
around 5.5 (mostly feminine), then don't ever reach 0. Fewer *she*
responses in 6-7 range than *he* responses in 1-2 range.
## Quadratic interaction
Now, plot the comparison for the Last vs First+Full condition
interaction.
```{r plot-quad-condition, warning=FALSE}
exp3_p_quadCond <- exp3_d %>%
mutate(Condition_Model = case_when(
Condition == "first" ~ "First + Full",
Condition == "full" ~ "First + Full",
Condition == "last" ~ "Last"
)) %>%
group_by(Condition_Model, Item, GenderRatingCentered) %>%
summarise(She.Mean = mean(She)) %>%
mutate(She.Log = log(She.Mean)) %>%
ggplot(aes(x = GenderRatingCentered, y = She.Log)) +
geom_smooth(fill = "red", color = "red") +
geom_point(fill = "red", color = "red") +
theme_classic() +
labs(
title = "Experiment 3: Log Odds of *She* Responses",
x = "Masculine - Feminine",
y = "Log Odds (Item Means)"
) +
theme(
text = element_text(size = 16),
plot.title = element_markdown()
)
exp3_p_quadCond
```
Dummy code to get the quadratic effect just for First and Full Name
conditions.
```{r model-quad-FF}
exp3_d %<>% mutate(Condition_FF = case_when(
Condition == "first" ~ 0,
Condition == "full" ~ 0,
Condition == "last" ~ 1
))
exp3_d$Condition_FF %<>% as.factor()
exp3_m_FF_quad <- glmer(
She ~ 1 + GenderRatingCentered + GenderRatingSquared +
Condition_FF + GenderRatingCentered:Condition_FF +
GenderRatingSquared:Condition_FF + (1 | Participant) + (1 | Item),
data = exp3_d, family = binomial
)
summary(exp3_m_FF_quad)
```
Dummy code to get the quadratic effect just for Last Name condition.
```{r model-quad-L}
exp3_d %<>% mutate(Condition_Last = case_when(
Condition == "first" ~ 1,
Condition == "full" ~ 1,
Condition == "last" ~ 0
))
exp3_d$Condition_Last %<>% as.factor()
exp3_m_L_quad <- glmer(
She ~ 1 + GenderRatingCentered + GenderRatingSquared +
Condition_Last + GenderRatingCentered:Condition_Last +
GenderRatingSquared:Condition_Last + (1 | Participant) + (1 | Item),
data = exp3_d, family = binomial
)
summary(exp3_m_L_quad)
```
```{r OR-quad}
exp3_m_FF_quad %>%
tidy() %>%
filter(term == "GenderRatingSquared") %>%
pull(estimate)
exp3_m_L_quad %>%
tidy() %>%
filter(term == "GenderRatingSquared") %>%
pull(estimate)
```
- Beta for quadratic gender rating in First + Full: -0.15\*\*\*
- Beta for quadratic gender rating in Last: -0.05508 .
# Participant Gender
## Setup/Data Summary
The third supplementary analysis looks at participant gender: if male
participants show a larger bias towards *he* responses than non-male
participants.
Participants entered their gender in a free-response box.
```{r count-subjGender}
exp3_d %>%
group_by(SubjGenderMale) %>%
summarise(total = n_distinct(Participant)) %>%
kable()
```
For this analysis, we exclude participants who did not respond (N=116)..
Because there are not enough participants to create 3 groups, we compare
male to non-male participants. Male participants (N=514) are coded as 1
and female (N=638), nonbinary (N=2), agender (N=1), and asexual (N=1)
participants are coded as 0.
Summary of responses by condition and participant gender:
```{r means-subjGender}
exp3_d_subjGender <- exp3_d %>% filter(!is.na(SubjGenderMale))
exp3_d_subjGender %<>% mutate(ResponseAll = case_when(
He == 1 ~ "He",
She == 1 ~ "She",
Other == 1 ~ "Other"
))
```
Participant gender is mean centered effects coded, comparing non-male
participants to male participants.
```{r contrast-coding-subj-gender}
exp3_d_subjGender$SubjGenderMale %<>% as.factor()
contrasts(exp3_d_subjGender$SubjGenderMale) <- cbind("NM_M" = c(-.5, .5))
contrasts(exp3_d_subjGender$SubjGenderMale)
```
## Model
Effects of Name Condition (first name, full name), the first name's
Gender Rating (centered, positive=more feminine), and Participant Gender
(non-male vs. male) on the likelihood of a *she* response as opposed to
*he* or *other* responses. The maximal model contains random intercepts
by item and by participant.
```{r model-subj-gender}
exp3_m_subjGender <- buildmer(
formula = She ~ Condition * GenderRatingCentered * SubjGenderMale +
(1 | Participant) + (1 | Item),
data = exp3_d_subjGender, family = binomial,
buildmerControl(direction = "order", quiet = TRUE)
)
summary(exp3_m_subjGender)
```
- Male participants less likely to produce *she* responses overall
- No interactions with participant gender significant
# Gender Rating Centering
The first name gender ratings aren't perfectly centered, partially
because mostly-feminine/somewhat-masculine names are much less common
than mostly-masculine/somewhat-feminine names.
```{r gender-rating-mean-center}
mean(exp3_d$GenderRating, na.rm = TRUE)
```
Does it make a difference if we center it on 4, the mean of the scale,
instead of 4.21, the mean of the items?
```{r gender-rating-abs-center}
exp3_d %<>% mutate(GenderRating4 = GenderRating - 4)
```
```{r model-gender-rating-recenter}
exp3_m_recenter <- glmer(
She ~ Condition * GenderRating4 + (1 | Participant) + (1 | Item),
exp3_d,
family = binomial
)
summary(exp3_m_recenter)
```
Here, the beta estimate for the intercept has a larger absolute value
(-1.76 vs -1.52), and the beta estimates for the condition effects is
slightly different (0.13 vs 0.15; 0.10 vs 0.09).