DATA
Private primary care clinics in Finland in 2016–2018: https://doi.org/10.17632/dwgrkmf7rg.1
Public primary care clinics (health stations) in Finland in 2016–2018: http://doi.org/10.17632/kpwzs2p4w9.1
FINNISH MUNICIPALITY CLASSIFICATION FIX
Use the following table to fix the Finnish municipality classification to any year between 1980–2024. The table includes all municipalities which have been subject to a merger during 1980–2024.
Tutorial: Fix the municipality classification to year 2018 by replacing the existing municipality ID conditionally, e.g. in Stata:
//Create a copy of your municipality ID variable
gen municipality_original_num=[name of your municipality ID variable]
//Make sure it is numeric
destring municipality_original_num, replace
//Add the 2018 municipality ID from the mergers data
merge m:1 municipality_original_num using [add file path here]mergers.dta, keep(master match) keepusing(mun_2018) nogenerate
//Replace the municipality ID for those IDs that are in the data (if mun_2018 is missing, then the ID did not change in 1980–2024)
replace municipality_original_num=mun_2018 if mun_2018!=.
//Rename
rename municipality_original_num municipality_2018_num
//Drop the temporary variable
drop mun_2018
In R:
#Required libraries
library(readr)
library(dplyr)
#Import the mergers data
mergers <- read_csv2("[add file path here]mergers.csv",
col_select = mun_2018)
#Add the 2018 municipality ID to your original data
df <- left_join([add name of your original table here],
mergers,
by=("[name of your municipality ID variable]" = "municipality_original_num"))
#Replace the municipality ID for those IDs that are in the data (if mun_2018 is missing, then the ID did not change in 1980–2024) and drop the temporary column
df <- df %>%
mutate([name of your municipality ID variable] = ifelse(!is.na(mun_2018),
mun_2018,
[name of your municipality ID variable])) %>%
select(-mun_2018)
Data: [xlsx] [txt] [dta] [csv]
Source code: [do]