-
Notifications
You must be signed in to change notification settings - Fork 0
/
exp2_analysis_main.Rmd
258 lines (209 loc) · 6.49 KB
/
exp2_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
---
title: 'Experiment 2: Main Analysis'
date: "`r Sys.Date()`"
output:
github_document:
toc: yes
toc_depth: 3
html_document:
toc: yes
toc_depth: '3'
df_print: paged
pdf_document:
toc: yes
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(broom.mixed)
library(insight)
library(kableExtra)
```
# Setup
Variable names:
- Experiment: exp2\_
- Data (\_d\_)
- d = main df
- count = sums of response types
- FF = First + Full Name conditions only
- Models (\_m\_)
- cond = effect of Condition (Last vs First+Full)
- nameGender = effects of Condition (First vs Full) and Name
Gender Rating
- 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
Load data and select columns used in model. See data/exp2_data_about.txt
for more details.
```{r load-data}
exp2_d <- read.csv("../data/exp2_data.csv",
stringsAsFactors = TRUE) %>%
rename("Participant" = "SubjID", "Item" = "NameShown") %>%
select(
Participant, SubjGenderMale,
Condition, GenderRating,
Item, Male, Female, Other
)
str(exp2_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}
exp2_d %<>% mutate(GenderRatingCentered = scale(GenderRating, scale = FALSE))
```
Set contrasts for name conditions.
```{r contrast-coding}
contrasts(exp2_d$Condition) <- cbind(
"last vs first/full" = c(.33, .33, -0.66),
"first vs full" = c(-.5, .5, 0)
)
contrasts(exp2_d$Condition)
```
Subset for gender rating effects (First and Full conditions only).
```{r subset-FF}
exp2_d_FF <- exp2_d %>% filter(Condition != "last")
exp2_d_FF$Condition %<>% droplevels()
contrasts(exp2_d_FF$Condition) <- cbind(
"first vs full" = c(-.5, .5)
) # add contrast back
contrasts(exp2_d_FF$Condition)
```
# Data Summary
Responses by condition.
```{r count-responses}
exp2_d %<>% mutate(ResponseAll = case_when(
Male == 1 ~ "Male",
Female == 1 ~ "Female",
Other == 1 ~ "Other"
))
exp2_d_count <- exp2_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(exp2_d_count, digits = 3)
```
- First name condition has most *female* responses
- Full name condition has second-most *female* responses
- Last name condition has fewest *female* responses
# Model 1: Condition
Effect of Condition (first name, last name, full name) on likelihood of
a *female* response, as opposed to a *male* or *other* response.
Participant and Item are included as random intercepts, with items
defined as the unique first, last and first + last name combinations.
Because the condition manipulations were fully between-subject and
between-item, fitting a random slope model was not possible.
```{r model-condition}
exp2_m_cond <- glmer(
Female ~ Condition + (1 | Participant) + (1 | Item),
data = exp2_d, family = binomial
)
summary(exp2_m_cond)
```
- Less likely overall to recall character as female.
- Less likely to recall character as female in the Last Name condition
as compared to the First and Full Name conditions.
## Odds Ratios: Intercept
```{r OR-intercept}
exp(get_intercept(exp2_m_cond))
exp(-get_intercept(exp2_m_cond))
```
0.42x less likely to recall as female overall (or: 2.37x more likely to
recall as male/other overall), p\<.001
## Odds Ratios: Last vs First+Full
```{r OR-L-FF}
exp2_m_cond %>%
tidy() %>%
filter(term == "Conditionlast vs first/full") %>%
pull(estimate) %>%
exp()
```
7.39x more likely to recall as female in First + Full compared to Last
(or: 7.39 more likely to recall as male in Last than in First + Full),
p\<.001
## Odds Ratios: Last Only
Dummy code with Last Name as 0, so that intercept is the Last Name
condition only.
```{r dummy-code-L}
exp2_d %<>% mutate(Condition_Last = case_when(
Condition == "first" ~ 1,
Condition == "full" ~ 1,
Condition == "last" ~ 0
))
exp2_d$Condition_Last %<>% as.factor()
```
```{r model-L}
exp2_m_L <- glmer(
Female ~ Condition_Last + (1 | Participant) + (1 | Item),
data = exp2_d, family = binomial
)
summary(exp2_m_L)
```
```{r OR-L}
exp(get_intercept(exp2_m_L))
exp(-get_intercept(exp2_m_L))
```
0.11x times less likely to recall as female in the Last Name condition
(or: 8.86x more likely to recall as male in the Last Name condition),
p\<.001
## Odds Ratios: First and Full Only
Dummy code with First and Full Name as 0, so that intercept is average
for these two conditions.
```{r dummy-code-FF}
exp2_d %<>% mutate(Condition_FF = case_when(
Condition == "first" ~ 0,
Condition == "full" ~ 0,
Condition == "last" ~ 1
))
exp2_d$Condition_FF %<>% as.factor()
```
```{r model-FF}
exp2_m_FF <- glmer(
Female ~ Condition_FF + (1 | Participant) + (1 | Item),
data = exp2_d, family = binomial
)
summary(exp2_m_FF)
```
```{r OR-FF}
exp(get_intercept(exp2_m_FF))
exp(-get_intercept(exp2_m_FF))
```
0.77x times less likely to recall characters as female in the First and
Full Name conditions (or: 1.29x more likely to use recall characters as
male in the First and Full Name conditions), p=.07
# Model 2: Condition \* Name Gender
Effects of Condition (first name, full name) and the first name's Gender
Rating (centered, positive=more feminine) on the likelihood of a
*female* response, as opposed to a *male* or *other* response. In
Experiment 2, the Last Name condition does not include any instances of
the gendered first name, so it is not included here. Participant and
Item are again included as random intercepts.
```{r model-gender-rating}
exp2_m_nameGender <- glmer(
Female ~ Condition * GenderRatingCentered + (1 | Participant) + (1 | Item),
data = exp2_d_FF, family = binomial
)
summary(exp2_m_nameGender)
```
- Less likely overall to recall character as female in the First and
Full Name conditions.
- Somewhat more likely to recall the character as female in the First
Name condition as compared to the Full Name condition (trending).
- More likely to recall character as female as first name becomes more
feminine.
- No interaction between name condition and first name gender rating.