## cc() is more convenient than c()!
weat = test_WEAT(
demodata,
labels=list(T1="King", T2="Queen", A1="Male", A2="Female"),
T1=cc("king, King"),
T2=cc("queen, Queen"),
A1=cc("male, man, boy, brother, he, him, his, son"),
A2=cc("female, woman, girl, sister, she, her, hers, daughter"),
seed=1)
weat
sc_weat = test_WEAT(
demodata,
labels=list(T1="Occupation", A1="Male", A2="Female"),
T1=cc("
architect, boss, leader, engineer, CEO, officer, manager,
lawyer, scientist, doctor, psychologist, investigator,
consultant, programmer, teacher, clerk, counselor,
salesperson, therapist, psychotherapist, nurse"),
A1=cc("male, man, boy, brother, he, him, his, son"),
A2=cc("female, woman, girl, sister, she, her, hers, daughter"),
seed=1)
sc_weat
if (FALSE) {
## the same as the first example, but using regular expression
weat = test_WEAT(
demodata,
labels=list(T1="King", T2="Queen", A1="Male", A2="Female"),
use.pattern=TRUE, # use regular expression below
T1="^[kK]ing$",
T2="^[qQ]ueen$",
A1="^male$|^man$|^boy$|^brother$|^he$|^him$|^his$|^son$",
A2="^female$|^woman$|^girl$|^sister$|^she$|^her$|^hers$|^daughter$",
seed=1)
weat
## replicating Caliskan et al.'s (2017) results
## WEAT7 (Table 1): d = 1.06, p = .018
## (requiring installation of the `sweater` package)
Caliskan.WEAT7 = test_WEAT(
as_wordvec(sweater::glove_math),
labels=list(T1="Math", T2="Arts", A1="Male", A2="Female"),
T1=cc("math, algebra, geometry, calculus, equations, computation, numbers, addition"),
T2=cc("poetry, art, dance, literature, novel, symphony, drama, sculpture"),
A1=cc("male, man, boy, brother, he, him, his, son"),
A2=cc("female, woman, girl, sister, she, her, hers, daughter"),
p.side=1, seed=1234)
Caliskan.WEAT7
# d = 1.055, p = .0173 (= 173 counts / 10000 permutation samples)
## replicating Caliskan et al.'s (2017) supplemental results
## WEAT7 (Table S1): d = 0.97, p = .027
Caliskan.WEAT7.supp = test_WEAT(
demodata,
labels=list(T1="Math", T2="Arts", A1="Male", A2="Female"),
T1=cc("math, algebra, geometry, calculus, equations, computation, numbers, addition"),
T2=cc("poetry, art, dance, literature, novel, symphony, drama, sculpture"),
A1=cc("male, man, boy, brother, he, him, his, son"),
A2=cc("female, woman, girl, sister, she, her, hers, daughter"),
p.side=1, seed=1234)
Caliskan.WEAT7.supp
# d = 0.966, p = .0221 (= 221 counts / 10000 permutation samples)
}
Run the code above in your browser using DataLab