<<

Eurostat – Labour Market Areas – Final Technical report – 1(37)

Labour Market Areas Final Technical report of the Finnish project September 2017

Data collection for sub-national statistics (Labour Market Areas)

Grant Agreement No. 08141.2015.001-2015.499

Yrjö Palttila, , 22 September 2017 Postal address: 3rd floor, FI-00022 Statistics Finland E-mail: [email protected]

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 2(37)

Contents:

1. Overview 1.1 Objective of the work 1.2 Finland’s national travel-to-work areas 1.3 Tasks of the project

2. Results of the Finnish project 2.1 Improving IT tools to facilitate the implementation of the method (Task 2) 2.2 The finished SAS IML module (Task 2) 2.3 Define Finland’s LMAs based on the EU method (Task 4)

3. Assessing the feasibility of implementation of the EU method 3.1 Feasibility of implementation of the EU method (Task 3) 3.2 Assessing the feasibility of the adaptation of the current method of Finland’s national travel-to-work areas to the proposed method (Task 3)

4. The use and the future of the LMAs

Appendix 1. Visualization of the test results (November 2016) Appendix 2. The lists of the LAU2s (test 12) (November 2016) Appendix 3. The finished SAS IML module LMAwSAS.1409 (September 2017)

1. Overview

1.1 Objective of the work

In the background of the action was the need for comparable functional areas in EU-wide territorial policy analyses. The NUTS cross-national regions cover the whole EU territory, but they are usually regional administrative areas, which are the re- sult of historical circumstances. The present national definitions of travel-to-work areas are not consistent in different countries.

One of the EU-wide efforts for comparability of functional areas has been the Urban Audit’s Functional Urban Areas, FUA (for- mer: Larger Urban Zones, LUZ). FUA-areas are based on commuting around , but FUA-areas do not cover all the travel-to-work areas.

The first aim of the Finnish project was to define preliminary al- ternatives of the Finnish Labour Market Areas (LMAs) as part of Europe and to compare them with Finland’s national travel-to- work areas. The preliminary Finnish LMAs have been based on the harmonised definition.

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 3(37)

The alternatives of Finnish LMAs which have been pre- sented in this report are only experimental. They have not been officially dealt with anywhere.

The second aim of the Finnish project was to build a tool which makes possible to use the SAS programme in defining of LMAs.

The tasks of the Finnish project did not include defining of cross-border LMAs.

1.2 Finland’s national travel-to-work areas

Statistics Finland has established an official national statistical classification of travel-to-work areas, which is based on the data on commuting in the register-based employment statistics.

Statistics Finland’s national travel-to-work area is formed by a central (LAU2 area) and surrounding . A municipality is considered to be a central municipality if at least one municipality commutes to it, and fewer than 25 per cent of its employed persons commute to areas outside the central municipality.

A surrounding municipality belongs to the travel-to-work area if at least 10 per cent of its labour force commute to the central municipality.

However, the municipality can belong to only one travel-to-work area. If at least 10 per cent of the employed persons of the mu- nicipality commute to two municipalities, it belongs to that travel-to-work area to which is commuted more. The municipal- ity can also belong to a travel-to-work area through some other municipality if at least 10 per cent of the employed persons of the municipality commute to that municipality that belongs to the travel-to-work area of some central municipality, but that is not the central municipality itself. Map A represents Statistics Finland’s national travel-to-work areas 2015.

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 4(37)

Map A. Statistics Finland’s national travel-to-work areas 2015.

On 1 January 2015, the classification contained 42 travel-to- work areas comprising a total of 224 municipalities (LAU2s). There were 93 municipalities that lay outside travel-to-work- areas. These municipalities with a low number of commuters were self-contained labour market areas.

Finland’s national method of travel-to-work areas’ delineation is also described in “Study on comparable Labour Market Areas – Final research report”, 2012 (Annex 1, page 121). The notes concerning Finland’s national method were:

‘A. It is a core-based hierarchical clustering procedure with a very simple linkage criterion: only the links between central elements of each cluster are considered

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 5(37)

‘B. Contiguity is not a restriction and non-contiguous travel-to- work areas are accepted (only a few cases in practice).

‘C. Travel-to-work areas do not have to fulfil any criteria apart from having a central municipality and a hinterland (no mini- mum/maximum levels for self-containment, population or area).

‘D. Travel-to-work areas with very low self-containment could be created, as the aggregated flows are not considered. For the same reason, municipalities could be assigned to travel-to-work areas to which few total workers commute, despite having stronger aggregated dependence to other neighbouring travel- to-work areas.

1.3 Tasks of the project

The tasks of the Finnish project are:

Task 2. Improve IT tools to facilitate the implementation of the method

Task 3. Assess the feasibility of implementation of the EU method

Task 4. Define LMAs based on the EU method (the task does not include defining of cross-border LMAs)

2. Results of the Finnish project

2.1 Improving IT tools to facilitate the implementation of the method (Task 2)

Task 2. Develop or improve IT tools to facilitate the implementa- tion of the method. In the framework of the Task Force an IT tool (a script based on open-source software “R”) has been de- veloped to support the proposed method (see annex B). The task could include the re-engineering of this existing script in order to improve the performance. Another possibility is to de- velop a new IT tool which caters for the specific requirements of the NSI. (Grant Application Documents; Technical Annex, para- graph 2, item 2).

Italian National Institute of Statistics (ISTAT) has developed a LabourMarketAreas package based on open-source software R to support the proposed method in the delineation of harmo- nised labour market areas (LMAs).

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 6(37)

The EU (TTWA) method is described in the Technical Annex of the Grant Application Documents (Annex A and B) and in the fi- nal report of the “Harmonised Labour Market Areas” Task Force, January 2015.

At Statistics Finland we are using the “SAS for Windows” statis- tical program. Only a couple of persons are familiar with the R program.

Originally our aim was to translate R-code of the EU Travel To Work Area (TTWA) algorithm to SAS-code. However, the struc- tures of the languages are quite different. Instead we have drawn up a SAS/IML (Interactive Matrix Language) procedure, which makes possible to call R functions from SAS program, and translation needed not to be made.

The R package LabourMarketAreas includes R function find- Clusters, which implements an iterative algorithm. The function makes labour market areas (LMAs) from commuting flow data between municipalities.

SAS/IML procedure introduces an interface that enables to call functions in the R statistical language from SAS/IML program.

Our interface to the R function findcluster included in the pack- age LabourMarketAreas was tested for version v1.0 (November 2016).

Our SAS/IML module LMAwSAS (TyossaKayntiAlueet) includes the same parameters as on the R function findClusters (minSZ, minSC, tarSZ, tarSC).

The module LMAwSAS (TyossaKayntiAlueet) produces SAS data sets (November 2016) (clusterlist.sas7bdat, clus- terlist_before0.sas7bdat, lwclus.sas7bdat, lwclus_before0.sas7bdat, mar- ginals.sas7bdat, marginals_before0.sas7bdat, notassigned.sas7bdat, re- servelist.sas7bdat, zerolistcommunities.sas7bdat, zerolistlwcom.sas7bdat, zerolistresidents.sas7bdat, zerolistworkers.sas7bdat).

2.2 The finished SAS IML module (Task 2)

The finished SAS IML module LMAwSAS.1409 (September 2017) is on Appendix 3 . It has been uploaded on the Cros por- tal page devoted to the LMA projects under IT tool with public access:

https://ec.europa.eu/eurostat/cros/content/labour-market-areas_en

This module has been tested with LabourMarketAreas version 3.1. Later versions will probably work, if the R function "find-

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 7(37)

Clusters" can be called with the following arguments: input, minSZ, minSC, tarSZ, tarSC.

Because the SAS UNIX users might have difficulties with RTF or WORD documents, the format of the file is txt.

2.3 Define Finland’s LMAs based on the EU method (Task 4)

Task 4. Define LMAs based on the EU method. Provide the list of the LAU2s composing the LMAs as well as documentation of the exact method used, the characteristics of the LMAs pro- duced. (Grant Application Documents; Technical Annex, para- graph 2, item 4).

The TTWA method

The TTWA method operates with two properties: self- containment and number of workers (persons employed). For both properties minimum and target values have to be defined to run the algorithm. Parameters of the R function findClusters set the level of desired size and self-containment of the LMAs:

minSZ = minimum number of workers (the size of the smallest LMA that can be considered)

minSC = minimum self-containment (possible values are usu- ally between 0.6 and 0.7; e.g. 0.6667 means that four out of six employees stay inside the area)

tarSZ = target number of workers (usually from 10 000 on- wards)

tarSC = target self-containment (common values are usually be- tween 0.75 and 0.8 but in specific situation also higher values can be selected)

Consequently, four parameters set the constraints to define what is considered to be an LMA.

Self-containment is measured for both, the supply and the de- mand side. Supply side self-containment (SSC) is the number of people living and working in an area divided by the number of residents in the area. Demand side self-containment (DSC) is the number of people living and working in an area divided by the number of jobs (residents and not-residents employed) in the area.

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 8(37)

The TTWA method considers a cluster of municipalities to be an LMA if a certain conditions is fulfilled by both supply and de- mand side self-containment. In practice, the algorithm assesses every municipality (LAU2) against above mentioned conditions. The algorithm searches most important commuting flows be- tween municipalities and groups LAU2s into LMAs (see Grant Application Documents; Technical Annex, Annex A).

Finland’s LMAs

We have tested with R program that the SAS/IML module LMAwSAS (TyossaKayntiAlueet) produces the same results as R function findClusters (November 2016).

The register-based Employment Statistics of Statistics Finland, which are updated every year, has been used as source data.

First has been formed a file, which contains all the commuting flows between Finnish municipalities in other words amounts of employed persons of all combinations of municipality of resi- dence and municipality of working place. There were 20 239 commuting flows between Finnish municipalities (including commuting flows inside municipality).

We have tested different combinations of parameters. In Table 1 is presented the test results of the Finnish project (November 2016). Visualization of the results is presented in Appendix 1.

In these tests we have used as values of target size (tarSZ) 10 000, 20 000 and 40 000 workers and as values of target self- containment (tarSC) 0.75 and 0.9.

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 9(37)

Table 1. The test results of the Finnish project

Source data: Statistics Finland, SQL-server, VE-tietovarasto, henkilo_vuosi -tabel reference year: 2013 (the end of the year) municipal division: 1 January 2013 = 1 January 2014, 320 municipalities (LAU2 areas) variable: ptoim1 = 11 (18-74 -years-olds employed persons)

test minS minSC tarSZ tarS Number Average Largest Smallest Average Number Nu m- Z C of LMAs number LMA LMA size of of LMAs ber of (at least of LAU (workers, (workers, LMA (only one LAU2 two per LMA EMP_live EMP_live (workers, LAU2) in LAU2s) ) ) EMP_live Hel- ) sinki LMA test 1 1000 0,6667 10000 0,75 69 4,25 698826 1611 32040 31 17 test 2 1000 0,6667 10000 0,9 62 5,1 702320 1611 36841 4 18 test 3 3000 0,6667 10000 0,75 70 4,46 698826 1611 32363 8 17 test 4 3000 0,6667 10000 0,9 58 5,48 702320 1611 39495 2 18 test 5 1000 0,6667 20000 0,75 69 4,22 698826 1611 31771 29 17 test 6 1000 0,6667 20000 0,9 53 6 702320 3256 43221 2 18 test 7 3000 0,6667 20000 0,75 68 4,59 698826 3256 33315 8 17 test 8 3000 0,6667 20000 0,9 48 6,65 702320 6126 47803 1 18 test 9 1000 0,6667 40000 0,75 67 4,36 698826 1611 32826 28 17 test 1000 0,6667 40000 0,9 42 7,6 702320 3256 54712 1 18 10 test 3000 0,6667 40000 0,75 66 4,74 698826 3256 34433 7 17 11 test 3000 0,6667 40000 0,9 40 7,8 702320 7484 57543 0 18 12

3. Assessing the feasibility of implementation of the EU method

Task 3. Assess the feasibility of implementation of the EU method. Assess and provide information on the implementation of the method in the NSI. If a national methodology already ex- ists the feasibility of the adaptation of the current method to the proposed one should be assessed. (Grant Application Docu- ments; Technical Annex, paragraph 2, item 3)

3.1 Feasibility of implementation of the EU method (Task 3)

The first aim was to assess the feasibility of implementation of the EU method.

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 10(37)

Input data

The register-based Employment Statistics of Statistics Finland, which are updated every year, has been used as source data. The data of Employment Statistics include both the municipality code of a person’s place of residence and the municipality code of his/her working place. Small Area Estimations for production of data at LMAs level is not needed in Finland.

From 2005, the employment pension insurance includes those aged 18 to 68, while previously the obligation to take out pen- sion insurance for employees already started from the age of 14. This is visible in the employment statistics from 2005 on- wards as a fall in employment by young people and a rise in the number of students. Statistics cannot be compiled reliably on employment by under-age people on the basis of register data.

Sensitivity tests

See Table 1 and Appendix 1 .

Selected national parameter set

The significant variance of the LAUs sizes is a common prob- lem. The number of the resulting LMAs could be reduced through increase of the target values (tarSZ, tarSC). It is as- sumed that the large LMAs will be more stable over time. How- ever, the LMAs must represent the reality as much as possible.

LMAs are clusters comprising two or more communities. The target is to have full coverage of the countries territories where it is possible. In test results 1, 5 and 9 (minSZ = 1000, tarSC = 0,75) there are many LMAs which has only one LAU2 area. In test result 12 there was no LAU2 outside LMAs (no LMA which has only one LAU2).

The list of the LAU2s (test 12) is on Appendix 2 . SAS data set: clusterList - allocation of each community (LAU2) to the corre- sponding LMA. Municipal division: 1 January 2013 = 1 January 2014, 320 municipalities (LAU 2 areas).

Number of LAU2s in LMA is 17 or 18 in all alternatives.

Finland is a country of sparse population with scattered built-up areas. The area of the country is 303 892 square kilometres. The population of the country is 5 471 753 (31 December

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 11(37)

2014). Average population density is 18 inhabitants per square kilometre.

The same set of parameters should be used for the whole terri- tory of a country. Which will be the preferred option - a single set of parameters for all countries or should parameters be dif- ferent for sparsely populated countries Finland and for densely populated countries in Central Europe ? The Member States of EU are very different structured in terms of geography.

3.2 Assessing the feasibility of the adaptation of the current method of Finland’s national travel-to-work areas to the proposed method (Task 3)

The second aim was to assess the feasibility of the adaptation of the current method of Finland’s national travel-to-work areas to the proposed method.

Statistics Finland’s national travel-to-work area is formed by a central municipality (LAU2 area) and surrounding municipalities. A surrounding municipality belongs to the travel-to-work area if at least 10 per cent of its labour force commute to the central municipality. The method includes no minimum or target levels for self-containment or number of workers.

2015 number of national travel-to-work areas (at least two LAUs in a travel-to-work area) was 42. 93 municipalities (LAU2s) in Finland were outside of the Travel to Work Flows (only one LAU2 in a travel-to-work area).

In the TTWA method there are no central municipalities. It op- erates with four parameters (minimum number of workers, minimum self-containment, target number of workers, target self-containment). It considers a cluster of municipalities to be an LMA if a certain conditions is fulfilled.

In test result 12 of this project number of LMAs (40) is almost the same as number of Finland’s national travel-to-work areas 2015. However, there were no LAU2s outside LMAs (no LMAs which had only one LAU2) and LMAs coverage the whole terri- tory of the country.

The adaptation of Finland’s national method’s central munici- palities to the TTWA method is probably not feasible. With the criterion, that at least 10 per cent of workers should commute to the central municipality, could be likewise. Finland’s national method and the TTWA method are quite different.

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 12(37)

4. The use and the future of the LMAs

Some countries such as have already used the LMAs to improve funding distribution while e.g. in Finland the concept is rather from research interest.

Based on the results of the LMA projects Eurostat might pro- pose to the member states to use the current version of the TTWA method for delineation of LMAs and to start in the future a voluntary data collection.

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 13(37)

Appendix 1. Visualization of the test results (November 2016)

Map 1. Number of LMAs (at least two LAUs) 68 Number of LMAs (only one LAU) 31

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 14(37)

Map 2. Number of LMAs (at least two LAUs) 62 Number of LMAs (only one LAU) 4

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 15(37)

Map 3. Number of LMAs (at least two LAUs) 70 Number of LMAs (only one LAU) 8

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 16(37)

Map 4. Number of LMAs (at least two LAUs) 58 Number of LMAs (only one LAU) 2

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 17(37)

Map 5. Number of LMAs (at least two LAUs) 69 Number of LMAs (only one LAU) 29

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 18(37)

Map 6. Number of LMAs (at least two LAUs) 53 Number of LMAs (only one LAU) 2

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 19(37)

Map 7. Number of LMAs (at least two LAUs) 68 Number of LMAs (only one LAU) 8

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 20(37)

Map 8. Number of LMAs (at least two LAUs) 48 Number of LMAs (only one LAU) 1

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 21(37)

Map 9. Number of LMAs (at least two LAUs) 67 Number of LMAs (only one LAU) 28

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 22(37)

Map 10. Number of LMAs (at least two LAUs) 42 Number of LMAs (only one LAU) 1

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 23(37)

Map 11. Number of LMAs (at least two LAUs) 66 Number of LMAs (only one LAU) 7

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 24(37)

Map 12. Number of LMAs (at least two LAUs) 40 Number of LMAs (only one LAU) 0

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 25(37)

Appendix 2. The list of the LAU2s (test 12) (November 2016)

SAS data set: clusterList - allocation of each community (LAU2 area) to the corresponding LMA. municipal division: 1 January 2013 = 1 January 2014, 320 municipalities (LAU2 areas)

Workers, LMA_number community_code_name EMP_live

3 005 Alajärvi 3611 3 010 4698 3 300 1481 3 759 Soini 749 3 934 1171 3 989 Ähtäri 2333 The whole LMA area 14043

17 061 6722 17 103 940 17 169 2356 17 430 6627 17 561 Oripää 573 17 619 1180 17 834 Tammela 2658 17 887 1886 17 981 Ypäjä 1036 The whole LMA area 23978

33 049 125228 33 091 Helsinki 296020 33 092 100564 33 106 Hyvinkää 20550 33 186 Järvenpää 19188 33 224 3751 33 235 3847 33 245 16458 33 257 17699 33 433 3494 33 444 20535 33 505 Mäntsälä 9409 33 543 Nurmijärvi 19578 33 611 2409 33 753 8983 33 755 2949 33 858 18244 33 927 13414 The whole LMA area 702320

43 082 4307 43 086 Hausjärvi 3942 43 109 Hämeenlinna 28373 43 165 7181

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 26(37)

43 694 Riihimäki 12769 The whole LMA area 56572

46 140 8726 46 239 908 46 263 3053 46 402 3747 46 595 1539 46 687 530 46 762 Sonkajärvi 1479 46 925 Vieremä 1506 The whole LMA area 21488

58 146 1795 58 167 29089 58 260 3833 58 276 6296 58 309 Outokumpu 2383 58 426 5039 58 607 Polvijärvi 1661 58 707 Rääkkylä 774 58 848 Tohmajärvi 1648 The whole LMA area 52518

67 077 1902 67 172 1669 67 179 Jyväskylä 55723 67 216 474 67 226 1456 67 256 554 67 265 Kivijärvi 381 67 275 1016 67 312 Kyyjärvi 490 67 410 7381 67 435 232 67 500 4191 67 592 Petäjävesi 1502 67 601 1495 67 729 Saarijärvi 3462 67 850 914 67 892 1361 67 931 2384 67 992 Äänekoski 6842 The whole LMA area 93429

73 105 Hyrynsalmi 809 73 205 14602 73 290 Kuhmo 3005 73 578 Paltamo 1206 73 620 Puolanka 935 73 697 Ristijärvi 501 73 765 4161

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 27(37)

73 777 Suomussalmi 2709 The whole LMA area 27928

77 099 761 77 143 2686 77 181 Jämijärvi 768 77 214 Kankaanpää 4779 77 230 940 77 250 Kihniö 785 77 413 Lavia 689 77 581 2535 77 608 839 77 747 516 The whole LMA area 15298

90 240 7395 90 241 3309 90 751 Simo 1099 90 845 1084 90 851 8538 90 976 1506 The whole LMA area 22931

94 177 783 94 182 Jämsä 8097 94 249 3623 94 291 743 94 495 Multia 587 94 508 Mänttä- 3857 94 702 1676 94 936 2495 The whole LMA area 21861

99 047 Enontekiö 751 99 261 Kittilä 2891 99 273 1553 99 498 931 99 854 1258 The whole LMA area 7384

103 052 Evijärvi 1104 103 074 465 103 217 2273 103 236 1952 103 272 19547 103 288 Kruunupyy 2922 103 421 Lestijärvi 298 103 584 979 103 849 1294 103 924 1396 The whole LMA area 32230

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 28(37)

110 075 Hamina 8084 110 285 20059 110 489 Miehikkälä 734 110 624 Pyhtää 2146 110 935 Virolahti 1357 The whole LMA area 32380

111 142 2781 111 286 33715 The whole LMA area 36496

117 174 1763 117 204 1025 117 297 45185 117 476 1481 117 686 1123 117 749 Siilinjärvi 9434 117 778 2747 117 844 618 117 857 936 117 921 748 The whole LMA area 65060

121 305 5903 121 614 1159 121 832 1393 The whole LMA area 8455

128 148 Inari 2751 128 320 Kemijärvi 2528 128 583 324 128 732 1212 128 742 399 128 758 Sodankylä 3569 128 890 505 The whole LMA area 11288

130 016 3190 130 081 Hartola 1107 130 098 9264 130 111 7200 130 283 Hämeenkoski 863 130 316 Kärkölä 1972 130 398 41049 130 532 6196 130 560 6657 130 576 1128 130 781 Sysmä 1374 The whole LMA area 80000

135 153 10487 135 405 29878

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 29(37)

135 416 1278 135 441 Luumäki 1900 135 689 Rautjärvi 1230 135 700 2015 135 739 1332 135 831 2073 The whole LMA area 50193

162 035 Brändö 212 162 043 Eckerö 438 162 060 Finström 1206 162 062 Föglö 270 162 065 Geta 228 162 076 731 162 170 2323 162 295 144 162 318 Kökar 99 162 417 943 162 438 184 162 478 Maarianhamina 5550 162 736 865 162 766 53 162 771 Sund 495 162 941 Vårdö 187 The whole LMA area 13928

168 097 816 168 178 2522 168 213 2009 168 491 22062 168 507 Mäntyharju 2219 168 588 634 168 623 811 The whole LMA area 31073

185 176 1637 185 422 3823 185 541 2833 185 911 Valtimo 798 The whole LMA area 9091

187 151 861 187 218 590 187 231 497 187 280 Korsnäs 972 187 287 Kristiinankaupunki 2794 187 545 Närpiö 4198 The whole LMA area 9912

192 072 345 192 139 Ii 3353 192 244 6975

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 30(37)

192 425 3685 192 436 742 192 494 3370 192 564 79798 192 615 Pudasjärvi 2608 192 630 Pyhäntä 536 192 785 983 192 791 2160 192 859 Tyrnävä 2426 192 889 Utajärvi 1026 The whole LMA area 108007

204 440 Luoto 2111 204 598 Pietarsaari 8071 204 599 Pedersören kunta 4992 204 893 Uusikaarlepyy 3429 The whole LMA area 18603

210 079 2772 210 442 1377 210 484 1112 210 531 2137 210 609 33234 210 886 5508 The whole LMA area 46140

225 018 2322 225 407 Lapinjärvi 1167 225 434 6434 225 504 Myrskylä 791 225 616 898 225 638 22408 The whole LMA area 34020

226 625 Pyhäjoki 1214 226 678 9455 226 748 1997 The whole LMA area 12666

230 050 5113 230 051 2450 230 102 4336 230 271 Kokemäki 3010 230 319 Köyliö 1154 230 400 3621 230 631 Pyhäranta 918 230 684 Rauma 16623 230 783 Säkylä 1945 230 895 6319 The whole LMA area 45489

237 683 1265

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 31(37)

237 698 25257 The whole LMA area 26522

242 078 Hanko 3435 242 149 Inkoo 2516 242 710 Raasepori 11782 The whole LMA area 17733

245 284 922 245 734 Salo 20718 245 761 3506 The whole LMA area 25146

249 046 515 249 580 1853 249 681 1373 249 740 13367 249 768 961 The whole LMA area 18069

251 145 5169 251 164 Jalasjärvi 3141 251 232 5579 251 233 6891 251 301 5503 251 403 Lappajärvi 1245 251 408 5969 251 743 Seinäjoki 26810 251 846 2039 The whole LMA area 62346

278 020 6917 278 108 Hämeenkyrö 4227 278 211 13070 278 418 Lempäälä 9460 278 536 13592 278 562 3639 278 604 8231 278 635 Pälkäne 2627 278 790 10023 278 837 94670 278 908 8115 278 922 1885 278 980 Ylöjärvi 13659 The whole LMA area 190115

287 019 Aura 1780 287 202 14004 287 304 308 287 322 Kemiönsaari 2674 287 423 7734 287 445 Parainen 6580

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 32(37)

287 480 823 287 481 4507 287 503 Mynämäki 3388 287 529 8199 287 538 2255 287 577 4749 287 636 Pöytyä 3550 287 680 10575 287 704 2813 287 738 1292 287 833 669 287 838 822 287 853 77215 287 918 969 The whole LMA area 154906

299 152 Isokyrö 1960 299 399 3506 299 475 Maalahti 2458 299 499 Mustasaari 9073 299 905 29840 299 946 Vöyri 2987 The whole LMA area 49824

302 090 Heinävesi 1184 302 171 1922 302 420 Leppävirta 3804 302 593 Pieksämäki 7165 302 915 7722 The whole LMA area 21797

316 009 1015 316 069 Haapajärvi 2819 316 071 2677 316 208 5063 316 317 Kärsämäki 943 316 483 Merijärvi 400 316 535 3965 316 563 2796 316 626 Pyhäjärvi 1964 316 691 Reisjärvi 1100 316 746 1791 316 977 5979 The whole LMA area 30512

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 33(37)

Appendix 3. The finished SAS IML module LMAwSAS.1409 (September 2017)

/* SAS/IML module LMAwSAS for using R package LabourMarketAreas (Daniela Ichim, Luisa Franconi, Michele D'Alo' and Guido van den Heuvelin, 2016) in SAS. This module copies the output of R function findClusters in LabourMarketAreas to the temporary work directory of SAS.

Version: 2.1 Date: 14th September 2017 Author: Ari Veijanen (Statistics Finland, [email protected]) Maintainer: Ari Veijanen (Statistics Finland, [email protected]) Requirements: (1) R software is installed in your computer. (2) R package LabourMarketAreas has been installed. (3) You have permission to call R from the SAS system. It may be necessary to change the RLANG system option. Contact your SAS support if necessary. (4) SAS procedure IML is available.

Assumptions: This module has been tested with LabourMarketAreas version 3.1. Later versions will probably work, if the R function "findClusters" can be called with the following arguments: input, minSZ, minSC, tarSZ, tarSC.

Input: This module is called with the same arguments as function findClusters of LabourMarketAreas. Details are below in the comments of the module code.

Output: The most important output will be in the following SAS data sets: clusterList - allocation of each community to the corresponding LMA. LWClus - flows between LMAs. marginals - main characteristics of the LMAs.

Usage (in SAS under Windows): proc iml; libname g 'g:/my_lma'; input = 'g.lma_input'; minSZ=3000; minSC=0.6667; tarSZ=40000; tarSC=0.9; load module=LMAwSAS; run LMAwSAS(input,minSZ,minSC,tarSZ,tarSC);

*/

/******************************************************************/ /* THE DEFINITION OF THE MODULE */ /******************************************************************/ /* The following lines define the SAS/IML module LMAwSAS. The definition starts by "start" and ends by "finish". The arguments of the module are as in function findClusters of LabourMarketAreas (definitions are essentially copied from the package):

(1) input is a SAS data set containing the commuting data. Each row corresponds to an observation i.e. a flow and each column corresponds to a variable.

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 34(37)

The variables must have the following names: - community_live, integer, contains the id number of the elementary zone of residence, - community_work, integer, contains the id number of the working community (elementary zone of work), - amount, integer, contains the number of employees commuting between the "community_live" and "community_work" (direction is important).

Missing values are not allowed. The community id must be positive. Only positive flows are present in the data frame.

(2) minSZ is an integer specifying the parameter containing the acceptable minimum size of an area. Must be positive.

(3) minSC is a numeric value in the interval (0,1) specifying the parameter representing the acceptable minimum self containment of an area. Usually values range from 0.6 to 0.7.

(4) tarSZ is an integer specifying the parameter containing the target size of an area. It must be greater than minSZ.

(5) tarSC is a numeric value in the interval (0,1) specifying the parameter representing the target self containment of an area. It must be greater than minSZ. Usually values range from 0.75 to 0.9. */ proc iml; start LMAwSAS(input,minSZ,minSC,tarSZ,tarSC);

/* Export the arguments into objects in R */ call ExportDataSetToR(input,"input"); call ExportMatrixToR(minSZ,"minSZ"); call ExportMatrixToR(minSC,"minSC"); call ExportMatrixToR(tarSZ,"tarSZ"); call ExportMatrixToR(tarSC,"tarSC");

/* The following lines define R code (a comment starts by #) */ submit / R ok=isOk;

###################################################### # R code ######################################################

# The package LabourMarketAreas is used by calling its function findClusters. # First, a few simple R functions are defined. # Note: data sets are often called "data frames" in R.

# R function transform.all transforms the necessary input variables to integer variables in R. # It also ensures that the input data set has the required variables. # Added in version 2.0. # # Arguments: # d - a data frame. It must have the following variables: "commu- nity_live","community_work","amount".

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 35(37)

# Value: # A data frame with variables "community_live","community_work","amount". # Their values are vectors of integers. # transform.all <- function(input) { required_variables <- c("community_live","community_work","amount") required_variables_in_input <- all(required_variables %in% names(input)) if (!required_variables_in_input) warning("The input must have variables community_live, community_work and amount") stopifnot(required_variables_in_input) transform <- function(n){as.integer(input[[n]])} newd <- data.frame(Reduce(cbind, lapply(required_variables,transform))) names(newd) <- required_variables newd }

# R function output.reserve.list creates a data frame from the "reserve.list" part of # the output of findClusters. If the variable community2 has no value, # a missing value NA is substituted. NA then becomes a missing value in a SAS data frame. # # Arguments: # rlist - component "reserve.list" in the output of findClusters. # Value: # A data frame with six variables (for details, see the documentation of findClusters in R): # "type", the reason for being assigned to the reserve list, # "iteration", the iteration in which the community was assigned to the reserve list; # "id_dissolved", the id of the dissolved cluster i.e. the cluster to which the # community belonged before being assigned to the reserve list; # "validity", the value of the validity of such cluster (in character format); # "community", the id of the community assigned to the reserve list; # "community2", the community belonging to the cluster being dissolved with the second # lowest validity (if available; otherwise NA) # Usage: # out <- findClusters(input,minSZ,minSC,tarSZ,tarSC) # output.reserve.list(out$reserve.list) # output.reserve.list <- function(rlist) { completed <- function(elem) { if (length(elem)==5) as.character(c(elem,NA)) else elem } d<-data.frame(Reduce(rbind,lapply(rlist,completed)),row.names=NULL,stringsAsFactors = FALSE) names(d)<-c("type","iteration","id_dissolved","validity","community","community2") d }

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 36(37)

# R function output.simple.list transforms a list into a data frame of one variable. # If the list is empty, the data frame has one observation with value "(empty)". # Arguments: # x - a list or a vector. May be empty or NULL. # name - the name of the variable in the data frame created. # Value: # A data frame with one variable named by argument name. # output.simple.list <- function(x,name) { if (length(x)==0) { d <- data.frame("(empty)") names(d)<-c(name) return(d) } d <- data.frame(Reduce(rbind,x),row.names=NULL) names(d)<-c(name) d }

# R function output.data transforms a given object into a data frame. # If the object is NULL, the data frame created has one observation with value "(empty)". # Otherwise, R library function data.frame does the transformation. # Arguments: # x - an object (type unspecified) # name - the name of the variable to be used if x is NULL. # Value: # A data frame created from argument x. # output.data <- function(x,name) { if (is.null(x)) { d <- data.frame("(empty)") names(d)<-name return(d) } data.frame(x) }

# Load the R package LabourMarketAreas library(LabourMarketAreas)

# Check the version of the package. # This code has been tested with version 3.1. if (!identical(packageDescription("LabourMarketAreas")$Version,"3.1")) warning("This module has been tested with version 3.1 of R package LabourMarketAreas")

# Call function findClusters and store the return value in variable "out". # "out" is a complicated list of data frames and other objects. out <- findClusters(transform.all(input),minSZ,minSC,tarSZ,tarSC,verbose=TRUE)

Yrjö Palttila, Statistics Finland, 22 September 2017

Eurostat – Labour Market Areas – Final Technical report – Finland 37(37)

# Store the components of "out" in separate data sets clusterList <- data.frame(out$lma$clusterList) LWClus <- data.frame(out$lma$LWClus) marginals <- data.frame(out$lma$marginals) comNotAssigned <- output.simple.list(out$comNotAssigned,"notAssigned") before0_clusterList <- data.frame(out$lma.before0$clusterList) before0_LWClus <- data.frame(out$lma.before0$LWClus) before0_marginals <- data.frame(out$lma.before0$marginals) reserveList <- output.reserve.list(out$reserve.list) zeroListCommunities <- output.simple.list(out$zero.list$Communities,"zero.list.communities") zeroListLWCom <- output.data(out$zero.list$LWCom,"LWCom") zeroListResidents <- output.data(out$zero.list$Residents,"Residents") zeroListWorkers <- output.data(out$zero.list$Workers,"Workers") communitiesMovements <- output.data(out$communitiesMovements) idcom_rel <- output.data(out$idcom_rel,"idcom")

# Print the warnings warnings()

###################### # The R code ends here ###################### endsubmit;

/* From here on, code is SAS/IML code again */

/* The data sets created in R are copied into the temporary directory of SAS. The names of the SAS data sets created here resemble corresponding names used in LabourMarketAreas. */ call ImportDataSetFromR("clusterList","clusterList"); call ImportDataSetFromR("LWClus","LWClus"); call ImportDataSetFromR("marginals","marginals"); call ImportDataSetFromR("comNotAssigned","comNotAssigned"); call ImportDataSetFromR("before0_clusterList","before0_clusterList"); call ImportDataSetFromR("before0_LWClus","before0_LWClus"); call ImportDataSetFromR("before0_marginals","before0_marginals"); call ImportDataSetFromR("reserveList","reserveList"); call ImportDataSetFromR("zeroListCommunities", "zeroListCommunities"); call ImportDataSetFromR("zeroListLWCom", "zeroListLWCom"); call ImportDataSetFromR("zeroListResidents", "zeroListResidents"); call ImportDataSetFromR("zeroListWorkers", "zeroListWorkers"); call ImportDataSetFromR("communitiesMovements", "communitiesMovements"); call ImportDataSetFromR("idcom_rel", "idcom_rel"); finish; store module=LMAwSAS;

/* The module LMAwSAS is now stored for later use */

Yrjö Palttila, Statistics Finland, 22 September 2017