5

Found this issue while working on a hobby project of mine. Stack Overflow survey converts salaries reported in other currencies to USD.

The survey from 2020 uses exchange rates from 2020-02-19: https://insights.stackoverflow.com/survey/2020

We converted salaries from user currencies to USD using the exchange rate on 2020-02-19, and also converted to annual salaries assuming 12 working months and 50 working weeks.

The survey from 2021 is supposed to use exchange rates from 2021-06-16: https://insights.stackoverflow.com/survey/2021

We converted salaries from user currencies to USD using the exchange rate on 2021-06-16, and also converted to annual salaries assuming 12 working months and 50 working weeks.

USD to EUR conversion rate on 2020-02-19 was 0.9251 (https://www.exchange-rates.org/exchange-rate-history/usd-eur-2020-02-19).

USD to EUR conversion rate on 2021-06-16 was 0.8337 (https://www.exchange-rates.org/exchange-rate-history/usd-eur-2021-06-16).

However, when inspecting full datasets, the exchange rate from 2020 is used in both years. See the following R code for details.

library(tidyverse)
library(janitor)


# download files ----------------------------------------------------------

download.file("http://info.stackoverflowsolutions.com/rs/719-EMH-566/images/stack-overflow-developer-survey-2020.zip", 
              'stack-overflow-developer-survey-2020.zip')

download.file("http://info.stackoverflowsolutions.com/rs/719-EMH-566/images/stack-overflow-developer-survey-2021.zip", 
              'stack-overflow-developer-survey-2021.zip')


# import ----------------------------------------------------------------

data_2020 <- 
  unz('stack-overflow-developer-survey-2020.zip', 'survey_results_public.csv') |> 
  read_csv() |> 
  clean_names()


data_2021 <- 
  unz('stack-overflow-developer-survey-2021.zip', 'survey_results_public.csv') |> 
  read_csv() |> 
  clean_names()



# check exchange rates for yearly frequencies ----------------------------

old <- options(pillar.sigfig = 10)

data_2020 |> 
  filter(currency_desc == 'European Euro') |> 
  select(comp_total, comp_freq, converted_comp) |> 
  filter(!is.na(comp_total)) |> 
  filter(comp_freq == 'Yearly') |> 
  mutate(exchange_rate = round(comp_total / converted_comp, 4)) |> 
  count(exchange_rate, sort = TRUE)
# Result:
# 0.9251

data_2021 |> 
  filter(currency == 'EUR European Euro') |>
  select(comp_total, comp_freq, converted_comp_yearly) |> 
  filter(!is.na(comp_total)) |> 
  filter(comp_freq == 'Yearly') |> 
  mutate(exchange_rate = round(comp_total / converted_comp_yearly, 4)) |> 
  count(exchange_rate, sort = TRUE)
# Result:
# 0.9251



# check exchange rates for monthly frequencies ----------------------------

data_2020 |> 
  filter(currency_desc == 'European Euro') |> 
  select(comp_total, comp_freq, converted_comp) |> 
  filter(!is.na(comp_total)) |> 
  filter(comp_freq == 'Monthly') |> 
  mutate(exchange_rate = round(comp_total * 12 / converted_comp, 3)) |> 
  count(exchange_rate, sort = TRUE)
# Result:
# 0.925

data_2021 |> 
  filter(currency == 'EUR European Euro') |>
  select(comp_total, comp_freq, converted_comp_yearly) |> 
  filter(!is.na(comp_total)) |> 
  filter(comp_freq == 'Monthly') |> 
  mutate(exchange_rate = round(comp_total * 12 / converted_comp_yearly, 3)) |> 
  count(exchange_rate, sort = TRUE)
# Result:
# 0.925

2
  • 3
    You are aware that there are several different sources of exchange rates, right? (sure, they might not vary from one another that much, but saying an exchange rate was X isn't strictly true) Sep 25 at 13:40
  • 5
    It's highly unlikely that an exchange rate from another source would be ~10% different from my values and at the same time exactly the same as the value from prevous yaar. Most probably a SO employee used a script from the previuos year and forgot to make appropriate changes.
    – tomaz
    Sep 25 at 19:42

0

You must log in to answer this question.

Browse other questions tagged .