-
Notifications
You must be signed in to change notification settings - Fork 0
/
exp1_analysis_main.Rmd
254 lines (207 loc) · 6.27 KB
/
exp1_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
---
title: 'Experiment 1: Main Analyses'
date: "`r Sys.Date()`"
output:
github_document:
toc: yes
toc_depth: 3
pdf_document:
toc: yes
toc_depth: 3
html_document:
toc: yes
toc_depth: '3'
df_print: paged
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(broom.mixed)
library(insight)
library(kableExtra)
```
# Setup
Variable names:
- Experiment: exp1\_
- 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/exp1_data_about.txt
for more details.
```{r load-data}
exp1_d <- read.csv("../data/exp1_data.csv",
stringsAsFactors = TRUE) %>%
rename("Participant" = "SubjID", "Item" = "NameShown") %>%
select(
Participant, SubjGenderMale, Condition, GenderRating,
Item, He, She, Other
)
str(exp1_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}
exp1_d %<>% mutate(GenderRatingCentered = scale(GenderRating, scale = FALSE))
```
Set contrasts for name conditions.
```{r contrast-coding}
contrasts(exp1_d$Condition) <- cbind(
"last vs first/full" = c(.33, .33, -0.66),
"first vs full" = c(-.5, .5, 0)
)
contrasts(exp1_d$Condition)
```
Subset for gender rating effects (First and Full conditions only).
```{r subset-FF}
exp1_d_FF <- exp1_d %>% filter(Condition != "last")
exp1_d_FF$Condition %<>% droplevels()
contrasts(exp1_d_FF$Condition) <- cbind(
"first vs full" = c(-.5, .5)
) # add contrast back
contrasts(exp1_d_FF$Condition)
```
# Data Summary
Responses by condition.
```{r count-responses}
exp1_d %<>% mutate(ResponseAll = case_when(
He == 1 ~ "He",
She == 1 ~ "She",
Other == 1 ~ "Other"
))
exp1_d_count <- exp1_d %>%
group_by(Condition, ResponseAll) %>%
summarise(n = n()) %>%
pivot_wider(
names_from = ResponseAll,
values_from = n
) %>%
mutate(
She_HeOther = She / (He + Other),
She_He = She / He
) %>%
select(She, He, Other, She_HeOther, She_He)
kable(exp1_d_count, digits = 3, align = "c")
```
- First name condition has second-most *she* responses
- Full name condition has most *she* responses
- Last name condition has fewest *she* responses
# Model 1: Condition
Effect of Condition (first name, last name, full name) on likelihood of
a *she* response, as opposed to a *he* 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}
exp1_m_cond <- glmer(
She ~ Condition + (1 | Participant) + (1 | Item),
data = exp1_d, family = binomial
)
summary(exp1_m_cond)
```
- Fewer *she* responses overall
- First+Full have more *she* responses than Last. Full has more *she*
responses than First (n.s. but matches ratios).
## Odds Ratios: Intercept
```{r OR-intercept}
exp(get_intercept(exp1_m_cond))
exp(-get_intercept(exp1_m_cond))
```
0.24x less likely to use to use *she* overall (or: 4.17x more likely to
use *he* or *other* overall), p\<.001
## Odds Ratios: Last vs First+Full
```{r OR-L-FF}
exp1_m_cond %>%
tidy() %>%
filter(term == "Conditionlast vs first/full") %>%
pull(estimate) %>%
exp()
```
16.85x more likely to use *she* in First + Full compared to Last (or:
16.85 times more likely to use *he* and *other* 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}
exp1_d %<>% mutate(Condition_Last = case_when(
Condition == "first" ~ 1,
Condition == "full" ~ 1,
Condition == "last" ~ 0
))
exp1_d$Condition_Last %<>% as.factor()
```
```{r model-L}
exp1_m_L <- glmer(
She ~ Condition_Last + (1 | Participant) + (1 | Item),
data = exp1_d, family = binomial
)
summary(exp1_m_L)
```
```{r OR-L}
exp(get_intercept(exp1_m_L))
exp(-get_intercept(exp1_m_L))
```
0.04x times less likely to use *she* in the Last Name condition (or:
26.91x more likely to use *he* and *other* 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}
exp1_d %<>% mutate(Condition_FF = case_when(
Condition == "first" ~ 0,
Condition == "full" ~ 0,
Condition == "last" ~ 1
))
exp1_d$Condition_FF %<>% as.factor()
```
```{r model-FF}
exp1_m_FF <- glmer(
She ~ Condition_FF + (1 | Participant) + (1 | Item),
data = exp1_d, family = binomial
)
summary(exp1_m_FF)
```
```{r OR-FF}
exp(get_intercept(exp1_m_FF))
exp(-get_intercept(exp1_m_FF))
```
0.70x times less likely to use *she* in the First and Full Name
conditions (or: 1.42x more likely to use *he* and *other* in the First
and Full Name conditions), p=.26
# 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 *she*
response, as opposed to a *he* or *other* response. In Experiment 1, the
Last Name condition does not include any instances of the gendered first
name, so only the First and Full Name conditions are analyzed here.
Participant and Item are again included as random intercepts.
```{r model-gender-rating}
exp1_m_nameGender <- glmer(
She ~ Condition * GenderRatingCentered + (1 | Participant) + (1 | Item),
exp1_d_FF,
family = binomial
)
summary(exp1_m_nameGender)
```
- More *she* responses as first names become more feminine.
- Difference between First and Full is now significant (as compared to
condition-only model).