library(labelled)
library(codebook)
library(tidyverse)
knitr::opts_chunk$set(
  warning = FALSE, # show warnings during codebook generation
  message = FALSE, # show messages during codebook generation
  error = TRUE, # do not interrupt codebook generation in case of errors,
                # usually makes debugging easier, and sometimes half a codebook
                # is better than none
  echo = FALSE  # don't show the R code
)
ggplot2::theme_set(ggplot2::theme_bw())

Load data

Codebook

Metadata

Description

Dataset name: vcs

The dataset has N=2241 rows and 21 columns. 969 rows have no missing values on any column.

Metadata for search engines
  • Date published: 2021-04-10
x
voice_id
dataset
sex
age
f0
f1
f2
f3
f4
pf
neuro
extra
openn
agree
consc
dominance
behavior
attitude
desire
soir_full
sex_c

#Variables

voice_id

Distribution

Distribution of values for voice_id

Distribution of values for voice_id

0 missing values.

Summary statistics

name data_type n_missing complete_rate min median max mean sd hist label
voice_id numeric 0 1 1 1121 2241 1121 647.0653 ▇▇▇▇▇ NA

dataset

Distribution

Distribution of values for dataset

Distribution of values for dataset

0 missing values.

Summary statistics

name data_type n_missing complete_rate min median max mean sd hist label
dataset numeric 0 1 1 4 11 4.531905 2.864653 ▇▃▃▂▁ NA

sex

Sex

Distribution

Distribution of values for sex

Distribution of values for sex

0 missing values.

Summary statistics

name label data_type n_missing complete_rate min median max mean sd n_value_labels hist
sex Sex haven_labelled 0 1 -1 -1 1 -0.1726908 0.9851959 2 ▇▁▁▁▁▁▁▆

Value labels

Response choices
name value
male 1
female -1

age

Age

Distribution

Distribution of values for age

Distribution of values for age

137 missing values.

Summary statistics

name label data_type n_missing complete_rate min median max mean sd hist
age Age numeric 137 0.9388666 18 23 56 24.452 6.138718 ▇▂▁▁▁

f0

Voice pitch

Distribution

Distribution of values for f0

Distribution of values for f0

7 missing values.

Summary statistics

name label data_type n_missing complete_rate min median max mean sd hist
f0 Voice pitch numeric 7 0.9968764 -1.8 0.39 2.6 0 1 ▇▂▇▆▁

f1

Distribution

Distribution of values for f1

Distribution of values for f1

4 missing values.

Summary statistics

name data_type n_missing complete_rate min median max mean sd hist label
f1 numeric 4 0.9982151 -2.3 -0.03 6.7 0 1 ▅▇▁▁▁ NA

f2

Distribution

Distribution of values for f2

Distribution of values for f2

4 missing values.

Summary statistics

name data_type n_missing complete_rate min median max mean sd hist label
f2 numeric 4 0.9982151 -3 0.023 5.2 0 1 ▁▇▆▁▁ NA

f3

Distribution

Distribution of values for f3

Distribution of values for f3

4 missing values.

Summary statistics

name data_type n_missing complete_rate min median max mean sd hist label
f3 numeric 4 0.9982151 -2.3 0.12 3.2 0 1 ▃▆▇▃▁ NA

f4

Distribution

Distribution of values for f4

Distribution of values for f4

4 missing values.

Summary statistics

name data_type n_missing complete_rate min median max mean sd hist label
f4 numeric 4 0.9982151 -2.8 0.2 2.7 0 1 ▁▇▅▇▁ NA

pf

Formants

Distribution

Distribution of values for pf

Distribution of values for pf

4 missing values.

Summary statistics

name label data_type n_missing complete_rate min median max mean sd hist
pf Formants numeric 4 0.9982151 -2.1 0.053 4.4 0 1 ▆▇▇▁▁

neuro

Neuroticism

Distribution

Distribution of values for neuro

Distribution of values for neuro

802 missing values.

Summary statistics

name label data_type n_missing complete_rate min median max mean sd hist
neuro Neuroticism numeric 802 0.6421241 -2.4 0.00029 2.5 0 1 ▂▆▇▅▂

extra

Extraversion

Distribution

Distribution of values for extra

Distribution of values for extra

803 missing values.

Summary statistics

name label data_type n_missing complete_rate min median max mean sd hist
extra Extraversion numeric 803 0.6416778 -3.2 0.036 2.2 0 1 ▁▃▇▇▃

openn

Openness

Distribution

Distribution of values for openn

Distribution of values for openn

802 missing values.

Summary statistics

name label data_type n_missing complete_rate min median max mean sd hist
openn Openness numeric 802 0.6421241 -4.1 0.097 2.1 0 1 ▁▁▅▇▃

agree

Agreeableness

Distribution

Distribution of values for agree

Distribution of values for agree

802 missing values.

Summary statistics

name label data_type n_missing complete_rate min median max mean sd hist
agree Agreeableness numeric 802 0.6421241 -3.4 0.037 2.2 0 1 ▁▂▇▇▃

consc

Conscientiousness

Distribution

Distribution of values for consc

Distribution of values for consc

802 missing values.

Summary statistics

name label data_type n_missing complete_rate min median max mean sd hist
consc Conscientiousness numeric 802 0.6421241 -3.4 0.053 2.2 0 1 ▁▂▇▇▃

dominance

Dominance

Distribution

Distribution of values for dominance

Distribution of values for dominance

1256 missing values.

Summary statistics

name label data_type n_missing complete_rate min median max mean sd hist
dominance Dominance numeric 1256 0.4395359 -3.7 0.053 2.6 0 1 ▁▂▇▆▂

behavior

Distribution

Distribution of values for behavior

Distribution of values for behavior

242 missing values.

Summary statistics

name data_type n_missing complete_rate min median max mean sd hist label
behavior numeric 242 0.8920125 -1.1 -0.27 3 0 1 ▇▃▃▁▁ NA

attitude

Distribution

Distribution of values for attitude

Distribution of values for attitude

239 missing values.

Summary statistics

name data_type n_missing complete_rate min median max mean sd hist label
attitude numeric 239 0.8933512 -1.9 0.058 1.5 0 1 ▅▅▆▆▇ NA

desire

Distribution

Distribution of values for desire

Distribution of values for desire

238 missing values.

Summary statistics

name data_type n_missing complete_rate min median max mean sd hist label
desire numeric 238 0.8937974 -1.8 -0.095 2.2 0 1 ▆▇▇▅▂ NA

soir_full

Unrestricted sociosexuality

Distribution

Distribution of values for soir_full

Distribution of values for soir_full

243 missing values.

Summary statistics

name label data_type n_missing complete_rate min median max mean sd hist
soir_full Unrestricted sociosexuality numeric 243 0.8915663 -2.1 0.017 2.8 0 1 ▅▇▇▅▁

sex_c

Distribution

Distribution of values for sex_c

Distribution of values for sex_c

0 missing values.

Summary statistics

name data_type n_missing complete_rate min median max mean sd hist label
sex_c numeric 0 1 -1 -1 1 -0.1726908 0.9851959 ▇▁▁▁▆ NA

Missingness report

Codebook table

JSON-LD metadata

The following JSON-LD can be found by search engines, if you share this codebook publicly on the web.

{
  "name": "vcs",
  "datePublished": "2021-04-10",
  "description": "The dataset has N=2241 rows and 21 columns.\n969 rows have no missing values on any column.\n\n\n## Table of variables\nThis table contains variable names, labels, and number of missing values.\nSee the complete codebook for more.\n\n|name      |label                       | n_missing|\n|:---------|:---------------------------|---------:|\n|voice_id  |NA                          |         0|\n|dataset   |NA                          |         0|\n|sex       |Sex                         |         0|\n|age       |Age                         |       137|\n|f0        |Voice pitch                 |         7|\n|f1        |NA                          |         4|\n|f2        |NA                          |         4|\n|f3        |NA                          |         4|\n|f4        |NA                          |         4|\n|pf        |Formants                    |         4|\n|neuro     |Neuroticism                 |       802|\n|extra     |Extraversion                |       803|\n|openn     |Openness                    |       802|\n|agree     |Agreeableness               |       802|\n|consc     |Conscientiousness           |       802|\n|dominance |Dominance                   |      1256|\n|behavior  |NA                          |       242|\n|attitude  |NA                          |       239|\n|desire    |NA                          |       238|\n|soir_full |Unrestricted sociosexuality |       243|\n|sex_c     |NA                          |         0|\n\n### Note\nThis dataset was automatically described using the [codebook R package](https://rubenarslan.github.io/codebook/) (version 0.9.3).",
  "keywords": ["voice_id", "dataset", "sex", "age", "f0", "f1", "f2", "f3", "f4", "pf", "neuro", "extra", "openn", "agree", "consc", "dominance", "behavior", "attitude", "desire", "soir_full", "sex_c"],
  "@context": "http://schema.org/",
  "@type": "Dataset",
  "variableMeasured": [
    {
      "name": "voice_id",
      "@type": "propertyValue"
    },
    {
      "name": "dataset",
      "@type": "propertyValue"
    },
    {
      "name": "sex",
      "description": "Sex",
      "value": "1. male,\n-1. female",
      "maxValue": 1,
      "minValue": -1,
      "@type": "propertyValue"
    },
    {
      "name": "age",
      "description": "Age",
      "@type": "propertyValue"
    },
    {
      "name": "f0",
      "description": "Voice pitch",
      "@type": "propertyValue"
    },
    {
      "name": "f1",
      "@type": "propertyValue"
    },
    {
      "name": "f2",
      "@type": "propertyValue"
    },
    {
      "name": "f3",
      "@type": "propertyValue"
    },
    {
      "name": "f4",
      "@type": "propertyValue"
    },
    {
      "name": "pf",
      "description": "Formants",
      "@type": "propertyValue"
    },
    {
      "name": "neuro",
      "description": "Neuroticism",
      "@type": "propertyValue"
    },
    {
      "name": "extra",
      "description": "Extraversion",
      "@type": "propertyValue"
    },
    {
      "name": "openn",
      "description": "Openness",
      "@type": "propertyValue"
    },
    {
      "name": "agree",
      "description": "Agreeableness",
      "@type": "propertyValue"
    },
    {
      "name": "consc",
      "description": "Conscientiousness",
      "@type": "propertyValue"
    },
    {
      "name": "dominance",
      "description": "Dominance",
      "@type": "propertyValue"
    },
    {
      "name": "behavior",
      "@type": "propertyValue"
    },
    {
      "name": "attitude",
      "@type": "propertyValue"
    },
    {
      "name": "desire",
      "@type": "propertyValue"
    },
    {
      "name": "soir_full",
      "description": "Unrestricted sociosexuality",
      "@type": "propertyValue"
    },
    {
      "name": "sex_c",
      "@type": "propertyValue"
    }
  ]
}`

Gender differences

library(ggstatsplot)
## In case you would like cite this package, cite it as:
##      Patil, I. (2018). ggstatsplot: "ggplot2" Based Plots with Statistical Details. CRAN.
##      Retrieved from https://cran.r-project.org/web/packages/ggstatsplot/index.html
vcs <- vcs %>% filter(!is.na(f0), !is.na(pf), !is.na(age))

vcs$sex <- factor(if_else(vcs$sex_c == 1, "male", "female"))
contrasts(vcs$sex) <- contr.helmert(2)
var_label(vcs$sex) <- "Sex"
ggbetweenstats(vcs, sex, age) +
  scale_color_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## Warning: Ignoring unknown parameters: segment.linetype
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

ggbetweenstats(vcs, sex, f0) +
  scale_color_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## Warning: Ignoring unknown parameters: segment.linetype
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

ggbetweenstats(vcs, sex, pf) +
  scale_color_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## Warning: Ignoring unknown parameters: segment.linetype
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

ggbetweenstats(vcs, sex, dominance) +
  scale_color_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## Warning: Ignoring unknown parameters: segment.linetype
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

ggbetweenstats(vcs, sex, extra) +
  scale_color_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## Warning: Ignoring unknown parameters: segment.linetype
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

ggbetweenstats(vcs, sex, neuro) +
  scale_color_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## Warning: Ignoring unknown parameters: segment.linetype
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

ggbetweenstats(vcs, sex, consc) +
  scale_color_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## Warning: Ignoring unknown parameters: segment.linetype
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

ggbetweenstats(vcs, sex, agree) +
  scale_color_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## Warning: Ignoring unknown parameters: segment.linetype
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

ggbetweenstats(vcs, sex, openn) +
  scale_color_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## Warning: Ignoring unknown parameters: segment.linetype
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

ggbetweenstats(vcs, sex, soir_full) +
  scale_color_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## Warning: Ignoring unknown parameters: segment.linetype
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

ggbetweenstats(vcs, sex, behavior) +
  scale_color_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## Warning: Ignoring unknown parameters: segment.linetype
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

ggbetweenstats(vcs, sex, attitude) +
  scale_color_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## Warning: Ignoring unknown parameters: segment.linetype
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

ggbetweenstats(vcs, sex, desire) +
  scale_color_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## Warning: Ignoring unknown parameters: segment.linetype
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.

ggplot(vcs, aes(f0, fill = sex)) + 
  geom_histogram(position = "identity", alpha = 0.4)+
  scale_fill_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(vcs, aes(pf, fill = sex)) + 
  geom_histogram(position = "identity", alpha = 0.4)+
  scale_fill_viridis_d("Sex", breaks = c(-1,1), labels = c("female", "male")) 
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Distributions by dataset

ggplot(vcs, aes(f0, fill = factor(dataset))) + 
  geom_histogram(position = "stack", alpha = 0.4)+
  facet_wrap(~ sex) +
  scale_fill_viridis_d()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(vcs, aes(pf, fill = factor(dataset))) + 
  geom_histogram(position = "stack", alpha = 0.4)+
  facet_wrap(~ sex) +
  scale_fill_viridis_d()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(vcs, aes(pf, fill = factor(dataset))) + 
  geom_histogram(position = "identity", alpha = 0.4)+
  facet_wrap(~ sex) +
  scale_fill_viridis_d()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(vcs, aes(f1, fill = factor(dataset))) + 
  geom_histogram(position = "identity", alpha = 0.4)+
  facet_wrap(~ sex) +
  scale_fill_viridis_d()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(vcs, aes(f2, fill = factor(dataset))) + 
  geom_histogram(position = "identity", alpha = 0.4)+
  facet_wrap(~ sex) +
  scale_fill_viridis_d()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(vcs, aes(f3, fill = factor(dataset))) + 
  geom_histogram(position = "identity", alpha = 0.4)+
  facet_wrap(~ sex) +
  scale_fill_viridis_d()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(vcs, aes(f4, fill = factor(dataset))) + 
  geom_histogram(position = "identity", alpha = 0.4)+
  facet_wrap(~ sex) +
  scale_fill_viridis_d()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(vcs, aes(pf, fill = factor(dataset))) + 
  geom_histogram(position = "stack", alpha = 0.4)+
  facet_wrap(~ sex) +
  scale_fill_viridis_d()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Correlations

library(kableExtra)
## 
## Attaching package: 'kableExtra'
## The following object is masked from 'package:dplyr':
## 
##     group_rows
vcs %>% select(sex_c, age, f0, pf, f1:f4) %>%  cor(use = 'pairwise') %>% round(2) %>% kable(caption = "Correlations between sex, age, and voice parameters.")
Correlations between sex, age, and voice parameters.
sex_c age f0 pf f1 f2 f3 f4
sex_c 1.00 0.20 -0.93 -0.80 -0.26 -0.60 -0.83 -0.86
age 0.20 1.00 -0.23 -0.03 0.06 -0.01 -0.08 -0.08
f0 -0.93 -0.23 1.00 0.75 0.24 0.56 0.79 0.82
pf -0.80 -0.03 0.75 1.00 0.59 0.81 0.91 0.88
f1 -0.26 0.06 0.24 0.59 1.00 0.22 0.34 0.30
f2 -0.60 -0.01 0.56 0.81 0.22 1.00 0.71 0.66
f3 -0.83 -0.08 0.79 0.91 0.34 0.71 1.00 0.87
f4 -0.86 -0.08 0.82 0.88 0.30 0.66 0.87 1.00
vcs %>% select(sex_c, age, neuro:soir_full) %>%  cor(use = 'pairwise') %>% round(2) %>% kable(caption = "Correlations between sex, age, and personality variables")
Correlations between sex, age, and personality variables
sex_c age neuro extra openn agree consc dominance behavior attitude desire soir_full
sex_c 1.00 0.20 -0.26 -0.09 -0.01 -0.13 -0.12 -0.03 0.03 0.24 0.36 0.27
age 0.20 1.00 -0.12 -0.04 0.05 0.09 0.15 -0.12 0.30 0.04 0.10 0.18
neuro -0.26 -0.12 1.00 -0.23 -0.03 -0.20 -0.26 -0.33 -0.10 -0.08 -0.08 -0.11
extra -0.09 -0.04 -0.23 1.00 0.26 0.12 0.22 0.51 0.20 0.06 0.03 0.12
openn -0.01 0.05 -0.03 0.26 1.00 0.02 0.08 0.10 0.05 0.03 0.07 0.06
agree -0.13 0.09 -0.20 0.12 0.02 1.00 0.23 -0.22 0.01 -0.11 -0.06 -0.07
consc -0.12 0.15 -0.26 0.22 0.08 0.23 1.00 0.20 0.05 -0.12 -0.07 -0.06
dominance -0.03 -0.12 -0.33 0.51 0.10 -0.22 0.20 1.00 0.09 0.07 -0.02 0.06
behavior 0.03 0.30 -0.10 0.20 0.05 0.01 0.05 0.09 1.00 0.48 0.33 0.76
attitude 0.24 0.04 -0.08 0.06 0.03 -0.11 -0.12 0.07 0.48 1.00 0.45 0.85
desire 0.36 0.10 -0.08 0.03 0.07 -0.06 -0.07 -0.02 0.33 0.45 1.00 0.75
soir_full 0.27 0.18 -0.11 0.12 0.06 -0.07 -0.06 0.06 0.76 0.85 0.75 1.00
vcs %>% select( sex_c, everything(), -voice_id, -dataset, -sex) %>%  cor(use = 'pairwise') %>% round(2) %>% kable(caption = "All correlations")
All correlations
sex_c age f0 f1 f2 f3 f4 pf neuro extra openn agree consc dominance behavior attitude desire soir_full
sex_c 1.00 0.20 -0.93 -0.26 -0.60 -0.83 -0.86 -0.80 -0.26 -0.09 -0.01 -0.13 -0.12 -0.03 0.03 0.24 0.36 0.27
age 0.20 1.00 -0.23 0.06 -0.01 -0.08 -0.08 -0.03 -0.12 -0.04 0.05 0.09 0.15 -0.12 0.30 0.04 0.10 0.18
f0 -0.93 -0.23 1.00 0.24 0.56 0.79 0.82 0.75 0.27 0.06 -0.01 0.11 0.10 0.01 -0.07 -0.24 -0.36 -0.29
f1 -0.26 0.06 0.24 1.00 0.22 0.34 0.30 0.59 -0.02 0.09 0.07 -0.03 0.07 -0.02 -0.01 -0.09 -0.09 -0.08
f2 -0.60 -0.01 0.56 0.22 1.00 0.71 0.66 0.81 0.10 0.09 0.02 0.14 0.15 -0.04 0.02 -0.22 -0.26 -0.20
f3 -0.83 -0.08 0.79 0.34 0.71 1.00 0.87 0.91 0.18 0.09 0.04 0.16 0.16 -0.03 0.01 -0.21 -0.27 -0.20
f4 -0.86 -0.08 0.82 0.30 0.66 0.87 1.00 0.88 0.22 0.07 0.01 0.13 0.14 -0.01 0.01 -0.20 -0.29 -0.21
pf -0.80 -0.03 0.75 0.59 0.81 0.91 0.88 1.00 0.15 0.11 0.04 0.13 0.17 -0.03 0.01 -0.22 -0.28 -0.22
neuro -0.26 -0.12 0.27 -0.02 0.10 0.18 0.22 0.15 1.00 -0.23 -0.03 -0.20 -0.26 -0.33 -0.10 -0.08 -0.08 -0.11
extra -0.09 -0.04 0.06 0.09 0.09 0.09 0.07 0.11 -0.23 1.00 0.26 0.12 0.22 0.51 0.20 0.06 0.03 0.12
openn -0.01 0.05 -0.01 0.07 0.02 0.04 0.01 0.04 -0.03 0.26 1.00 0.02 0.08 0.10 0.05 0.03 0.07 0.06
agree -0.13 0.09 0.11 -0.03 0.14 0.16 0.13 0.13 -0.20 0.12 0.02 1.00 0.23 -0.22 0.01 -0.11 -0.06 -0.07
consc -0.12 0.15 0.10 0.07 0.15 0.16 0.14 0.17 -0.26 0.22 0.08 0.23 1.00 0.20 0.05 -0.12 -0.07 -0.06
dominance -0.03 -0.12 0.01 -0.02 -0.04 -0.03 -0.01 -0.03 -0.33 0.51 0.10 -0.22 0.20 1.00 0.09 0.07 -0.02 0.06
behavior 0.03 0.30 -0.07 -0.01 0.02 0.01 0.01 0.01 -0.10 0.20 0.05 0.01 0.05 0.09 1.00 0.48 0.33 0.76
attitude 0.24 0.04 -0.24 -0.09 -0.22 -0.21 -0.20 -0.22 -0.08 0.06 0.03 -0.11 -0.12 0.07 0.48 1.00 0.45 0.85
desire 0.36 0.10 -0.36 -0.09 -0.26 -0.27 -0.29 -0.28 -0.08 0.03 0.07 -0.06 -0.07 -0.02 0.33 0.45 1.00 0.75
soir_full 0.27 0.18 -0.29 -0.08 -0.20 -0.20 -0.21 -0.22 -0.11 0.12 0.06 -0.07 -0.06 0.06 0.76 0.85 0.75 1.00
cors <- vcs %>% select(sex_c, age, f0, dominance, extra, agree, behavior) %>%  cor(use = 'pairwise') %>% round(2)
cors_sex_partialled_out <- vcs %>% select(sex_c, age, f0, dominance, extra, agree, behavior) %>% mutate_at(vars(age, f0, dominance, extra, agree, behavior), ~resid(lm(. ~ sex_c, na.action = na.exclude))) %>%  cor(use = 'pairwise') %>% round(2)
cors[upper.tri(cors)] <- cors_sex_partialled_out[upper.tri(cors_sex_partialled_out)]

cors %>% kable(caption = "Correlations between sex, age, f0, and preregistered outcomes. Correlations above the diagonal are after partialling out effects of gender.")
Correlations between sex, age, f0, and preregistered outcomes. Correlations above the diagonal are after partialling out effects of gender.
sex_c age f0 dominance extra agree behavior
sex_c 1.00 0.00 0.00 0.00 0.00 0.00 0.00
age 0.20 1.00 -0.12 -0.12 -0.03 0.11 0.30
f0 -0.93 -0.23 1.00 -0.05 -0.06 -0.02 -0.11
dominance -0.03 -0.12 0.01 1.00 0.51 -0.22 0.10
extra -0.09 -0.04 0.06 0.51 1.00 0.11 0.20
agree -0.13 0.09 0.11 -0.22 0.12 1.00 0.01
behavior 0.03 0.30 -0.07 0.09 0.20 0.01 1.00