-
Notifications
You must be signed in to change notification settings - Fork 0
/
exp4_analysis_main.Rmd
325 lines (265 loc) · 8.11 KB
/
exp4_analysis_main.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
323
324
325
---
title: 'Experiment 4: Main 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}
library(tidyverse)
options(dplyr.summarise.inform = FALSE)
library(magrittr)
library(lme4)
library(lmerTest)
library(kableExtra)
library(broom.mixed)
library(insight)
```
# Setup
Variable names:
- Experiment: exp4\_
- Data (\_d\_)
- d = main df
- count =sums of response types
- Models (\_m\_)
- count =sums of response types
- all = effect of Condition and Name Gender Rating, including
*other* responses
- cond = effect of Condition only
- 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
- first = dummy coded with First Name condition as 0, Full Name
and Last Name conditions as 1
- full = dummy coded with Full Name condition as 0, First Name and
Last Name conditions as 1
Load data and select columns used in model. See data/exp4_data_about.txt
for more details.
```{r load-data}
exp4_d <- read.csv("../data/exp4_data.csv",
stringsAsFactors = TRUE) %>%
rename("Participant" = "SubjID", "Item" = "Name") %>%
select(
Participant, Condition, GenderRating,
Item, Male, Female, Other
)
str(exp4_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}
exp4_d %<>% mutate(GenderRatingCentered = scale(GenderRating, scale = FALSE))
```
Set contrasts for name conditions, now weighted to account for uneven
sample sizes. 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(exp4_d$Condition) <- centerfactor(
exp4_d$Condition, c("last", "first")
)
contrasts(exp4_d$Condition)
```
# Data Summary
Responses by condition.
```{r count-responses}
exp4_d %<>% mutate(ResponseAll = case_when(
Male == 1 ~ "Male",
Female == 1 ~ "Female",
Other == 1 ~ "Other"
))
exp4_d_count <- exp4_d %>%
group_by(Condition, ResponseAll) %>%
summarise(n = n()) %>%
pivot_wider(
names_from = ResponseAll,
values_from = n
) %>%
mutate(
Female_MaleOther = Female / (Male + Other),
Female_Male = Female / Male
)
kable(exp4_d_count)
```
- First name condition has second-most (slightly) *female* responses
- Full name condition has most *female* responses
- Last name condition has fewest *female* responses
# Main Model
Because Experiment 4 always introduces the character with a full name,
then manipulates the name form in the subsequent 3 references, the main
analysis is 1 model, as opposed to the 2 for Experiments 1 and 2.
Effects of Name Condition (first name, last name, full name) and first
name Gender Rating (centered, + fem, -masc) on the likelihood of
*female* responses, as opposed to *male* and *other* responses.
Participant and Item are included as random intercepts, with items
defined as the unique first, last and first + last name combinations.
Condition1 is the contrast between last and first+full. Condition2 is
the contrast between first and full.
```{r model-main}
exp4_m_all <- glmer(
Female ~ Condition * GenderRatingCentered + (1 | Participant) + (1 | Item),
data = exp4_d, family = binomial
)
summary(exp4_m_all)
```
- Less likely to recall character as female overall
- More likely to recall character as female in the First and Full Name
conditions than in the Last Name condition
- More likely to recall character as female as first names become more
feminine
**Double check the directions of the interactions:**
## L v F+F Interaction
Dummy code to get the gender rating effect for just the First and Full
Name conditions.
```{r model-dummy-code-FF}
exp4_d %<>% mutate(Condition_FF = case_when(
Condition == "first" ~ 0,
Condition == "full" ~ 0,
Condition == "last" ~ 1
))
exp4_d$Condition_FF %<>% as.factor()
exp4_m_all_FF <- glmer(
Female ~ Condition_FF * GenderRatingCentered +
(1 | Participant) + (1 | Item),
data = exp4_d, family = binomial
)
summary(exp4_m_all_FF)
```
Then dummy code to get the gender rating effect just in the Last Name
condition.
```{r model-dummy-code-L}
exp4_d %<>% mutate(Condition_Last = case_when(
Condition == "first" ~ 1,
Condition == "full" ~ 1,
Condition == "last" ~ 0
))
exp4_d$Condition_Last %<>% as.factor()
exp4_m_all_L <- glmer(
Female ~ Condition_Last * GenderRatingCentered +
(1 | Participant) + (1 | Item),
data = exp4_d, family = binomial
)
summary(exp4_m_all_L)
```
```{r OR-FF-L}
exp4_m_all_FF %>%
tidy() %>%
filter(term == "GenderRatingCentered") %>%
pull(estimate)
exp4_m_all_L %>%
tidy() %>%
filter(term == "GenderRatingCentered") %>%
pull(estimate)
```
Interaction indicates Gender Rating has a larger effect in the First and
Full Name conditions (0.81) than in the Last Name condition (0.67). This
makes sense because the gendered first name is repeated all 4x in the
First and Full name conditions, but only once in the Last Name
condition.
## F v F Interaction
Dummy code to get the gender rating effect for just the First Name
condition.
```{r model-dummy-code-first}
exp4_d %<>% mutate(Condition_First = case_when(
Condition == "first" ~ 0,
Condition == "full" ~ 1,
Condition == "last" ~ 1
))
exp4_d$Condition_First %<>% as.factor()
exp4_m_all_first <- glmer(
Female ~ Condition_First * GenderRatingCentered +
(1 | Participant) + (1 | Item),
data = exp4_d, family = binomial
)
summary(exp4_m_all_first)
```
Dummy code to get the gender rating effect for just the Full Name
condition.
```{r model-dummy-code-full}
exp4_d %<>% mutate(Condition_Full = case_when(
Condition == "first" ~ 1,
Condition == "full" ~ 0,
Condition == "last" ~ 1
))
exp4_d$Condition_Full %<>% as.factor()
exp4_m_all_full <- glmer(
Female ~ Condition_Full * GenderRatingCentered +
(1 | Participant) + (1 | Item),
data = exp4_d, family = binomial
)
summary(exp4_m_all_full)
```
```{r OR-F-F}
exp4_m_all_first %>%
tidy() %>%
filter(term == "GenderRatingCentered") %>%
pull(estimate)
exp4_m_all_full %>%
tidy() %>%
filter(term == "GenderRatingCentered") %>%
pull(estimate)
```
The effect of name gender rating is larger in the First Name condition
(0.86) than in the Full Name condition (0.76).
## Odds Ratios: Intercept
```{r OR-intercept}
exp(get_intercept(exp4_m_all))
exp(-get_intercept(exp4_m_all))
```
0.77x less likely to recall as female overall (or: 1.29x more likely to
recall as male overall), p\<.01
## Odds Ratios: Last vs First+Full
```{r OR-L-FF}
exp4_m_all %>%
tidy() %>%
filter(term == "Condition1") %>%
pull(estimate) %>%
exp()
```
1.13x more likely to recall as female in First + Full compared to Last,
p\<.05
## Odds Ratios: Last Only
Model with just Condition (to more directly compare to Exp 2).
```{r model-L}
exp4_m_cond_L <- glmer(
Female ~ Condition_Last + (1 | Participant) + (1 | Item),
data = exp4_d, family = binomial
)
summary(exp4_m_cond_L)
```
```{r OR-L}
exp(get_intercept(exp4_m_cond_L))
exp(-get_intercept(exp4_m_cond_L))
```
0.17x times less likely to recall as female in the Last Name condition
(or: 5.72x more likely to recall as male in the Last Name condition),
p=0.06
## Odds Ratios: First and Full Only
Dummy code with First and Full Name as 0, so that intercept is average
for these two conditions. Model with just Condition (to more directly
compare to Exp 2).
```{r model-FF}
exp4_m_cond_FF <- glmer(
Female ~ Condition_FF + (1 | Participant) + (1 | Item),
data = exp4_d, family = binomial
)
summary(exp4_m_cond_FF)
```
```{r OR-FF}
exp(get_intercept(exp4_m_cond_FF))
exp(-get_intercept(exp4_m_cond_FF))
```
0.82x less likely to recall as female in First and Full Name conditions
(or: 1.23x more likely to recall as male in First and Full Name
conditions), p=.29