For this exercise, please try to reproduce the results from Experiment 1 of the associated paper (Ko, Sadler & Galinsky, 2015). The PDF of the paper is included in the same folder as this Rmd file.

Methods summary:

A sense of power has often been tied to how we perceive each other’s voice. Social hierarchy is embedded into the structure of society and provides a metric by which others relate to one another. In 1956, the Brunswik Lens Model was introduced to examine how vocal cues might influence hierarchy. In “The Sound of Power: Conveying and Detecting Hierarchical Rank Through Voice,” Ko and colleagues investigated how manipulation of hierarchal rank within a situation might impact vocal acoustic cues. Using the Brunswik Model, six acoustic metrics were utilized (pitch mean & variability, loudness mean & variability, and resonance mean & variability) to isolate a potential contribution between individuals of different hierarchal rank. In the first experiment, Ko, Sadler & Galinsky examined the vocal acoustic cues of individuals before and after being assigned a hierarchal rank in a sample of 161 subjects (80 male). Each of the six hierarchy acoustic cues were analyzed with a 2 (high vs. low rank condition) x 2 (male vs. female) analysis of covariance, controlling for the baseline of the respective acoustic cue.


Target outcomes:

Below is the specific result you will attempt to reproduce (quoted directly from the results section of Experiment 1):

The impact of hierarchical rank on speakers’ acoustic cues. Each of the six hierarchy-based (i.e., postmanipulation) acoustic variables was submitted to a 2 (condition: high rank, low rank) × 2 (speaker’s sex: female, male) between-subjects analysis of covariance, controlling for the corresponding baseline acoustic variable. Table 4 presents the adjusted means by condition. Condition had a significant effect on pitch, pitch variability, and loudness variability. Speakers’ voices in the high-rank condition had higher pitch, F(1, 156) = 4.48, p < .05; were more variable in loudness, F(1, 156) = 4.66, p < .05; and were more monotone (i.e., less variable in pitch), F(1, 156) = 4.73, p < .05, compared with speakers’ voices in the low-rank condition (all other Fs < 1; see the Supplemental Material for additional analyses of covariance involving pitch and loudness). (from Ko et al., 2015, p. 6; emphasis added)

The adjusted means for these analyses are reported in Table 4 (Table4_AdjustedMeans.png, included in the same folder as this Rmd file).


Step 1: Load packages

library(tidyverse) # for data munging
library(knitr) # for kable table formating
library(haven) # import and export 'SPSS', 'Stata' and 'SAS' Files
library(readxl) # import excel files

# #optional packages:
library(psych)
library(car) # for ANCOVA
library(compute.es) # for ANCOVA
library(lsmeans) # for ANCOVA

Step 2: Load data

# Just Experiment 1
d <-read_csv("data/S1_voice_level_Final.csv")
# DT::datatable(d)

Step 3: Tidy data

# d %>% mutate(rank_condition = factor(ifelse(plev == 1,"high","low"))) %>%
#   group_by(rank_condition) %>% summarize_all(mean)#%>% select(contains("pitch") | contains("intense")) %>% mean()
table.4.vars <- d %>% mutate(rank_condition = factor(ifelse(plev == 1,"high","low"))) %>%
  pivot_longer(cols = c("form_smean","form_rmean","form_svar","form_rvar"
                            ,"intense_smean","intense_rmean","intense_svar",
                            "intense_rvar","pitch_smean","pitch_rmean",
                            "pitch_svar","pitch_rvar") , names_to = "script_type", values_to = "values") %>% 
  separate(script_type,sep = "_",into = c("cue","script_measure")) %>% 
  mutate(cue = factor(ifelse(cue == "form","resonance",ifelse(cue == "intense","loudness","pitch")))) %>%
  mutate(measure = factor(str_extract(script_measure, "(mean)|(var)")) )%>%
  select(rank_condition,cue,script_measure,values) %>%
  group_by(rank_condition, cue, script_measure) %>% 
  summarize_all(mean)
table.4.vars
## # A tibble: 24 × 4
## # Groups:   rank_condition, cue [6]
##    rank_condition cue       script_measure  values
##    <fct>          <fct>     <chr>            <dbl>
##  1 high           loudness  rmean             57.5
##  2 high           loudness  rvar             185. 
##  3 high           loudness  smean             59.4
##  4 high           loudness  svar             198. 
##  5 high           pitch     rmean            147. 
##  6 high           pitch     rvar            1715. 
##  7 high           pitch     smean            156. 
##  8 high           pitch     svar            1403. 
##  9 high           resonance rmean           1290. 
## 10 high           resonance rvar           63202. 
## # … with 14 more rows
# d %>% mutate(rank_condition = factor(ifelse(plev == 1,"high","low"))) %>%
#   group_by(rank_condition) %>% summarize_all(mean)#%>% select(contains("pitch") | contains("intense")) %>% mean()
t1 <- d %>% mutate(rank_condition = factor(ifelse(plev == 1,"high","low"))) %>% 
  # select(-c(voice, pow, age, sex, race, native, feelpower, plev, vsex, Zpitch_rmean, Zpitch_rvar, Zform_rmean, Zform_rvar, 
  #           Zintense_rmean, Zintense_rvar, Zpitch_smean, Zpitch_svar, Zform_smean, Zform_svar, Zintense_smean, Zintense_svar)) %>%
  select(-c("formant_smeanMD","formant_rmeanMD","formant_svarMD","formant_rvarMD"
                            ,"intense_smeanMD","intense_rmeanMD","intense_svarMD",
                            "intense_rvarMD","pitch_smeanMD","pitch_rmeanMD",
                            "pitch_svarMD","pitch_rvarMD",)) %>%
  
  pivot_longer(cols = c("form_smean","form_rmean","form_svar","form_rvar"
                            ,"intense_smean","intense_rmean","intense_svar",
                            "intense_rvar","pitch_smean","pitch_rmean",
                            "pitch_svar","pitch_rvar", ) , names_to = "script_type", values_to = "values") %>% 
  separate(script_type,sep = "_",into = c("cue","script_measure")) %>% 
  mutate(cue = factor(ifelse(cue == "form","resonance",ifelse(cue == "intense","loudness","pitch")))) %>%
  mutate(measure = factor(str_extract(script_measure, "(mean)|(var)")) ) 
  # mutate(adj = factor(ifelse(str_ends(script_measure,"MD"),"Adj","Score"))) %>%
  # pivot_wider(names_from = adj,values_from = values) %>% 
  # mutate(adj_values = Adj + Score) %>%
  # select(rank_condition,cue,script_measure,adj_values) %>%
  # group_by(rank_condition, cue, script_measure) %>% 
  # summarize_all(mean)

t2 <- d %>% mutate(rank_condition = factor(ifelse(plev == 1,"high","low"))) %>% 
  # select(-c(voice, pow, age, sex, race, native, feelpower, plev, vsex, Zpitch_rmean, Zpitch_rvar, Zform_rmean, Zform_rvar, 
  #           Zintense_rmean, Zintense_rvar, Zpitch_smean, Zpitch_svar, Zform_smean, Zform_svar, Zintense_smean, Zintense_svar)) %>%
  select(-c("form_smean","form_rmean","form_svar","form_rvar"
                            ,"intense_smean","intense_rmean","intense_svar",
                            "intense_rvar","pitch_smean","pitch_rmean",
                            "pitch_svar","pitch_rvar", ) ) %>%
  pivot_longer(cols = c("formant_smeanMD","formant_rmeanMD","formant_svarMD","formant_rvarMD"
                            ,"intense_smeanMD","intense_rmeanMD","intense_svarMD",
                            "intense_rvarMD","pitch_smeanMD","pitch_rmeanMD",
                            "pitch_svarMD","pitch_rvarMD",) , names_to = "script_type", values_to = "values") %>% 
  separate(script_type,sep = "_",into = c("cue","script_measure")) %>% 
  mutate(cue = factor(ifelse(cue == "formant","resonance",ifelse(cue == "intense","loudness","pitch")))) %>%
  mutate(measure = factor(str_extract(script_measure, "(mean)|(var)")) ) 
  # mutate(adj = factor(ifelse(str_ends(script_measure,"MD"),"Adj","Score"))) %>%
  # pivot_wider(names_from = adj,values_from = values) %>% 
  # mutate(adj_values = Adj + Score) %>%
  # select(rank_condition,cue,script_measure,adj_values) %>%
  # group_by(rank_condition, cue, script_measure) %>% 
  # summarize_all(mean)

t1 %>% inner_join(t2,by=names(t1)[1:24]) %>% group_by(rank_condition, cue, script_measure) %>% summarize_all(mean)
## # A tibble: 0 × 28
## # Groups:   rank_condition, cue [0]
## # … with 28 variables: rank_condition <fct>, cue <fct>, script_measure <chr>,
## #   voice <dbl>, pow <dbl>, age <dbl>, sex <dbl>, race <dbl>, native <dbl>,
## #   feelpower <dbl>, plev <dbl>, vsex <dbl>, Zpitch_rmean <dbl>,
## #   Zpitch_rvar <dbl>, Zform_rmean <dbl>, Zform_rvar <dbl>,
## #   Zintense_rmean <dbl>, Zintense_rvar <dbl>, Zpitch_smean <dbl>,
## #   Zpitch_svar <dbl>, Zform_smean <dbl>, Zform_svar <dbl>,
## #   Zintense_smean <dbl>, Zintense_svar <dbl>, values.x <dbl>, …
# table.4.vars
# d %>% mutate(rank_condition = factor(ifelse(plev == 1,"high","low"))) %>%
#   group_by(rank_condition) %>% summarize_all(mean)#%>% select(contains("pitch") | contains("intense")) %>% mean()
t1 <- d %>% mutate(rank_condition = factor(ifelse(plev == 1,"high","low"))) %>% 
  mutate(resonance_s_mean = form_smean + formant_smeanMD,
         resonance_r_mean = form_rmean + formant_rmeanMD,
         resonance_s_var = form_svar + formant_svarMD,
         resonance_r_var = form_rvar + formant_rvarMD,
         loud_s_mean = intense_smean + intense_smeanMD,
         loud_s_var = intense_svar + intense_svarMD,
         loud_r_mean = intense_rmean + intense_rvarMD,
         loud_r_var = intense_rvar + intense_rvarMD,
         pitch_s_mean = pitch_smean + pitch_smeanMD,
         pitch_s_var = pitch_svar + pitch_svarMD,
         pitch_r_mean = pitch_rmean + pitch_rmeanMD,
         pitch_r_var = pitch_rvar + pitch_rvarMD,
         ) %>% 
  # select(-c(voice, pow, age, sex, race, native, feelpower, plev, vsex, Zpitch_rmean, Zpitch_rvar, Zform_rmean, Zform_rvar, 
  #           Zintense_rmean, Zintense_rvar, Zpitch_smean, Zpitch_svar, Zform_smean, Zform_svar, Zintense_smean, Zintense_svar)) %>%
  select(-c("formant_smeanMD","formant_rmeanMD","formant_svarMD","formant_rvarMD"
                            ,"intense_smeanMD","intense_rmeanMD","intense_svarMD",
                            "intense_rvarMD","pitch_smeanMD","pitch_rmeanMD",
                            "pitch_svarMD","pitch_rvarMD",)) %>%
  
  pivot_longer(cols = c(resonance_s_mean,
         resonance_r_mean,
         resonance_s_var,
         resonance_r_var,
         loud_s_mean,
         loud_s_var,
         loud_r_mean,
         loud_r_var,
         pitch_s_mean,
         pitch_s_var,
         pitch_r_mean,
         pitch_r_var,
         ) , names_to = "script_type", values_to = "values") %>% 
  separate(script_type,sep = "_",into = c("cue","script", "measure")) %>% 
  mutate(cue = factor(cue)) %>% 
  # mutate(measure = factor(str_extract(script_measure, "(mean)|(var)")) ) 
  # mutate(adj = factor(ifelse(str_ends(script_measure,"MD"),"Adj","Score"))) %>%
  # pivot_wider(names_from = adj,values_from = values) %>%
  # mutate(adj_values = Adj + Score) %>%
  select(rank_condition,cue,measure,values) %>%
  group_by(rank_condition, cue, measure) %>%
  summarize_all(mean)

# t2 <- d %>% mutate(rank_condition = factor(ifelse(plev == 1,"high","low"))) %>% 
#   # select(-c(voice, pow, age, sex, race, native, feelpower, plev, vsex, Zpitch_rmean, Zpitch_rvar, Zform_rmean, Zform_rvar, 
#   #           Zintense_rmean, Zintense_rvar, Zpitch_smean, Zpitch_svar, Zform_smean, Zform_svar, Zintense_smean, Zintense_svar)) %>%
#   select(-c("form_smean","form_rmean","form_svar","form_rvar"
#                             ,"intense_smean","intense_rmean","intense_svar",
#                             "intense_rvar","pitch_smean","pitch_rmean",
#                             "pitch_svar","pitch_rvar", ) ) %>%
#   pivot_longer(cols = c("formant_smeanMD","formant_rmeanMD","formant_svarMD","formant_rvarMD"
#                             ,"intense_smeanMD","intense_rmeanMD","intense_svarMD",
#                             "intense_rvarMD","pitch_smeanMD","pitch_rmeanMD",
#                             "pitch_svarMD","pitch_rvarMD",) , names_to = "script_type", values_to = "values") %>% 
#   separate(script_type,sep = "_",into = c("cue","script_measure")) %>% 
#   mutate(cue = factor(ifelse(cue == "formant","resonance",ifelse(cue == "intense","loudness","pitch")))) %>%
#   mutate(measure = factor(str_extract(script_measure, "(mean)|(var)")) ) 
#   # mutate(adj = factor(ifelse(str_ends(script_measure,"MD"),"Adj","Score"))) %>%
#   # pivot_wider(names_from = adj,values_from = values) %>% 
#   # mutate(adj_values = Adj + Score) %>%
#   # select(rank_condition,cue,script_measure,adj_values) %>%
#   # group_by(rank_condition, cue, script_measure) %>% 
#   # summarize_all(mean)
# 
# t1 %>% inner_join(t2,by=names(t1)[1:23])

# table.4.vars
t1
## # A tibble: 12 × 4
## # Groups:   rank_condition, cue [6]
##    rank_condition cue       measure  values
##    <fct>          <fct>     <chr>     <dbl>
##  1 high           loud      mean       59.7
##  2 high           loud      var       197. 
##  3 high           pitch     mean      150. 
##  4 high           pitch     var      1473. 
##  5 high           resonance mean     1206. 
##  6 high           resonance var     51701. 
##  7 low            loud      mean       56.7
##  8 low            loud      var       176. 
##  9 low            pitch     mean      157. 
## 10 low            pitch     var      1824. 
## 11 low            resonance mean     1216. 
## 12 low            resonance var     55410.

Step 4: Run analysis

Pre-processing

Descriptive statistics

In the paper, the adjusted means by condition are reported (see Table 4, or Table4_AdjustedMeans.png, included in the same folder as this Rmd file). Reproduce these values below:

Inferential statistics

The impact of hierarchical rank on speakers’ acoustic cues. Each of the six hierarchy-based (i.e., postmanipulation) acoustic variables was submitted to a 2 (condition: high rank, low rank) × 2 (speaker’s sex: female, male) between-subjects analysis of covariance, controlling for the corresponding baseline acoustic variable. […] Condition had a significant effect on pitch, pitch variability, and loudness variability. Speakers’ voices in the high-rank condition had higher pitch, F(1, 156) = 4.48, p < .05; were more variable in loudness, F(1, 156) = 4.66, p < .05; and were more monotone (i.e., less variable in pitch), F(1, 156) = 4.73, p < .05, compared with speakers’ voices in the low-rank condition (all other Fs < 1; see the Supplemental Material for additional analyses of covariance involving pitch and loudness).

# reproduce the above results here

Step 5: Reflection

Were you able to reproduce the results you attempted to reproduce? If not, what part(s) were you unable to reproduce?

I was not able to produce any of those results in the time.

How difficult was it to reproduce your results?

I needed https://osf.io/h6ywr?view_only=24a186cebd52441ea0170ed63caf70ab to just figure out what they were saying with the variables, but I couldn’t figure out the methods they used to get the adjusted data.

What aspects made it difficult? What aspects made it easy?

Terrible variable labels, unclear methods .