proportions and cluster

This commit is contained in:
pab 2026-05-22 10:29:17 +02:00
parent b1fdb08399
commit a4d296bd0f
14 changed files with 1069 additions and 2 deletions

View file

@ -0,0 +1,291 @@
municipality,cluster
Pajala,1
Vansbro,1
Norsjö,1
Årjäng,1
Strömsund,1
Övertorneå,1
Ovanåker,1
Torsby,1
Överkalix,1
Uppvidinge,1
Dorotea,1
Åsele,1
Sorsele,1
Ragunda,1
Malå,1
Bjurholm,2
Gällivare,1
Vindeln,1
Bengtsfors,1
Vilhelmina,1
Eda,1
Hultsfred,1
Jokkmokk,1
Älvdalen,1
Vetlanda,1
Älvsbyn,1
Hylte,1
Ånge,1
Högsby,2
Lycksele,1
Gislaved,1
Sävsjö,1
Robertsfors,2
Örnsköldsvik,1
Ydre,2
Vimmerby,1
Kramfors,1
Arjeplog,1
Tingsryd,1
Ljusdal,1
Hagfors,1
Gnosjö,1
Emmaboda,1
Tranemo,1
Storuman,1
Sollefteå,1
Arvidsjaur,1
Nordanstig,2
Markaryd,1
Gullspång,1
Kalix,1
Sunne,1
Bräcke,2
Berg,1
Ockelbo,2
Dals-Ed,1
Ödeshög,2
Ljungby,1
Nordmaling,2
Hällefors,1
Mellerud,2
Valdemarsvik,2
Piteå,1
Kiruna,1
Härjedalen,1
Kinda,2
Laxå,1
Vara,1
Torsås,2
Arvika,1
Mönsterås,1
Säffle,1
Färgelanda,2
Essunga,2
Askersund,1
Olofström,1
Lindesberg,1
Filipstad,1
Skinnskatteberg,1
Bollnäs,1
Västervik,1
Haparanda,1
Munkfors,1
Vaggeryd,1
Ljusnarsberg,1
Herrljunga,1
Oskarshamn,1
Svenljunga,2
Vingåker,2
Mora,1
Hudiksvall,1
Tanum,1
Smedjebacken,2
Skellefteå,1
Falköping,1
Värnamo,1
Söderhamn,1
Laholm,2
Östra Göinge,2
Töreboda,1
Hofors,1
Storfors,2
Tranås,1
Åmål,1
Malung-Sälen,1
Gotland,1
Nybro,1
Flen,1
Borgholm,1
Tidaholm,1
Ulricehamn,1
Ludvika,1
Ronneby,1
Aneby,2
Munkedal,2
Örkelljunga,2
Alvesta,2
Gagnef,2
Lessebo,2
Grums,2
Eksjö,1
Leksand,1
Strömstad,1
Nässjö,1
Hjo,1
Boxholm,2
Hedemora,1
Degerfors,2
Katrineholm,1
Rättvik,1
Östhammar,1
Orsa,1
Motala,1
Mark,1
Orust,2
Sölvesborg,2
Tierp,1
Finspång,1
Lysekil,1
Grästorp,2
Simrishamn,1
Avesta,1
Sotenäs,1
Mullsjö,2
Nora,1
Kungsör,2
Hörby,2
Åtvidaberg,1
Heby,2
Säter,2
Falkenberg,1
Hässleholm,1
Vårgårda,2
Karlsborg,1
Götene,2
Tomelilla,2
Krokom,2
Sandviken,1
Sjöbo,2
Osby,2
Kristianstad,3
Sala,1
Halmstad,3
Karlshamn,1
Bromölla,2
Tibro,2
Boden,3
Karlskrona,3
Norberg,2
Varberg,3
Lekeberg,2
Lilla Edet,2
Köping,1
Hallsberg,2
Älvkarleby,2
Eskilstuna,3
Mörbylånga,2
Forshaga,2
Lidköping,2
Svalöv,2
Öckerö,2
Vännäs,2
Perstorp,2
Tjörn,2
Kristinehamn,2
Söderköping,2
Falun,3
Arboga,2
Klippan,2
Kil,2
Vadstena,2
Surahammar,2
Hallstahammar,2
Jönköping,3
Mjölby,2
Älmhult,2
Gnesta,2
Mariestad,2
Åre,3
Bjuv,2
Härnösand,3
Karlskoga,3
Borås,3
Norrtälje,3
Åstorp,2
Skurup,2
Skara,2
Norrköping,3
Habo,2
Växjö,3
Båstad,2
Fagersta,3
Höör,2
Gävle,3
Borlänge,3
Skövde,3
Örebro,3
Kumla,2
Höganäs,2
Ängelholm,2
Luleå,3
Nyköping,3
Uddevalla,2
Kalmar,3
Trosa,2
Umeå,3
Strängnäs,2
Trelleborg,2
Enköping,2
Vänersborg,2
Oxelösund,3
Bollebygd,2
Alingsås,2
Sundsvall,3
Stenungsund,2
Östersund,3
Nykvarn,4
Eslöv,2
Ystad,2
Västerås,3
Trollhättan,3
Timrå,2
Kungsbacka,4
Södertälje,3
Landskrona,3
Nynäshamn,2
Karlstad,3
Linköping,3
Håbo,4
Ale,4
Helsingborg,3
Kungälv,2
Lerum,4
Ekerö,4
Svedala,4
Kävlinge,4
Vellinge,4
Härryda,4
Österåker,4
Göteborg,3
Staffanstorp,4
Burlöv,4
Hammarö,4
Botkyrka,4
Värmdö,4
Uppsala,3
Sigtuna,4
Upplands-Bro,4
Malmö,3
Haninge,4
Partille,4
Salem,4
Knivsta,4
Vallentuna,4
Tyresö,4
Huddinge,4
Mölndal,4
Upplands Väsby,4
Lomma,4
Lund,4
Vaxholm,4
Järfälla,4
Stockholm,4
Sollentuna,4
Lidingö,4
Nacka,4
Täby,4
Danderyd,4
Sundbyberg,4
Solna,4
1 municipality cluster
2 Pajala 1
3 Vansbro 1
4 Norsjö 1
5 Årjäng 1
6 Strömsund 1
7 Övertorneå 1
8 Ovanåker 1
9 Torsby 1
10 Överkalix 1
11 Uppvidinge 1
12 Dorotea 1
13 Åsele 1
14 Sorsele 1
15 Ragunda 1
16 Malå 1
17 Bjurholm 2
18 Gällivare 1
19 Vindeln 1
20 Bengtsfors 1
21 Vilhelmina 1
22 Eda 1
23 Hultsfred 1
24 Jokkmokk 1
25 Älvdalen 1
26 Vetlanda 1
27 Älvsbyn 1
28 Hylte 1
29 Ånge 1
30 Högsby 2
31 Lycksele 1
32 Gislaved 1
33 Sävsjö 1
34 Robertsfors 2
35 Örnsköldsvik 1
36 Ydre 2
37 Vimmerby 1
38 Kramfors 1
39 Arjeplog 1
40 Tingsryd 1
41 Ljusdal 1
42 Hagfors 1
43 Gnosjö 1
44 Emmaboda 1
45 Tranemo 1
46 Storuman 1
47 Sollefteå 1
48 Arvidsjaur 1
49 Nordanstig 2
50 Markaryd 1
51 Gullspång 1
52 Kalix 1
53 Sunne 1
54 Bräcke 2
55 Berg 1
56 Ockelbo 2
57 Dals-Ed 1
58 Ödeshög 2
59 Ljungby 1
60 Nordmaling 2
61 Hällefors 1
62 Mellerud 2
63 Valdemarsvik 2
64 Piteå 1
65 Kiruna 1
66 Härjedalen 1
67 Kinda 2
68 Laxå 1
69 Vara 1
70 Torsås 2
71 Arvika 1
72 Mönsterås 1
73 Säffle 1
74 Färgelanda 2
75 Essunga 2
76 Askersund 1
77 Olofström 1
78 Lindesberg 1
79 Filipstad 1
80 Skinnskatteberg 1
81 Bollnäs 1
82 Västervik 1
83 Haparanda 1
84 Munkfors 1
85 Vaggeryd 1
86 Ljusnarsberg 1
87 Herrljunga 1
88 Oskarshamn 1
89 Svenljunga 2
90 Vingåker 2
91 Mora 1
92 Hudiksvall 1
93 Tanum 1
94 Smedjebacken 2
95 Skellefteå 1
96 Falköping 1
97 Värnamo 1
98 Söderhamn 1
99 Laholm 2
100 Östra Göinge 2
101 Töreboda 1
102 Hofors 1
103 Storfors 2
104 Tranås 1
105 Åmål 1
106 Malung-Sälen 1
107 Gotland 1
108 Nybro 1
109 Flen 1
110 Borgholm 1
111 Tidaholm 1
112 Ulricehamn 1
113 Ludvika 1
114 Ronneby 1
115 Aneby 2
116 Munkedal 2
117 Örkelljunga 2
118 Alvesta 2
119 Gagnef 2
120 Lessebo 2
121 Grums 2
122 Eksjö 1
123 Leksand 1
124 Strömstad 1
125 Nässjö 1
126 Hjo 1
127 Boxholm 2
128 Hedemora 1
129 Degerfors 2
130 Katrineholm 1
131 Rättvik 1
132 Östhammar 1
133 Orsa 1
134 Motala 1
135 Mark 1
136 Orust 2
137 Sölvesborg 2
138 Tierp 1
139 Finspång 1
140 Lysekil 1
141 Grästorp 2
142 Simrishamn 1
143 Avesta 1
144 Sotenäs 1
145 Mullsjö 2
146 Nora 1
147 Kungsör 2
148 Hörby 2
149 Åtvidaberg 1
150 Heby 2
151 Säter 2
152 Falkenberg 1
153 Hässleholm 1
154 Vårgårda 2
155 Karlsborg 1
156 Götene 2
157 Tomelilla 2
158 Krokom 2
159 Sandviken 1
160 Sjöbo 2
161 Osby 2
162 Kristianstad 3
163 Sala 1
164 Halmstad 3
165 Karlshamn 1
166 Bromölla 2
167 Tibro 2
168 Boden 3
169 Karlskrona 3
170 Norberg 2
171 Varberg 3
172 Lekeberg 2
173 Lilla Edet 2
174 Köping 1
175 Hallsberg 2
176 Älvkarleby 2
177 Eskilstuna 3
178 Mörbylånga 2
179 Forshaga 2
180 Lidköping 2
181 Svalöv 2
182 Öckerö 2
183 Vännäs 2
184 Perstorp 2
185 Tjörn 2
186 Kristinehamn 2
187 Söderköping 2
188 Falun 3
189 Arboga 2
190 Klippan 2
191 Kil 2
192 Vadstena 2
193 Surahammar 2
194 Hallstahammar 2
195 Jönköping 3
196 Mjölby 2
197 Älmhult 2
198 Gnesta 2
199 Mariestad 2
200 Åre 3
201 Bjuv 2
202 Härnösand 3
203 Karlskoga 3
204 Borås 3
205 Norrtälje 3
206 Åstorp 2
207 Skurup 2
208 Skara 2
209 Norrköping 3
210 Habo 2
211 Växjö 3
212 Båstad 2
213 Fagersta 3
214 Höör 2
215 Gävle 3
216 Borlänge 3
217 Skövde 3
218 Örebro 3
219 Kumla 2
220 Höganäs 2
221 Ängelholm 2
222 Luleå 3
223 Nyköping 3
224 Uddevalla 2
225 Kalmar 3
226 Trosa 2
227 Umeå 3
228 Strängnäs 2
229 Trelleborg 2
230 Enköping 2
231 Vänersborg 2
232 Oxelösund 3
233 Bollebygd 2
234 Alingsås 2
235 Sundsvall 3
236 Stenungsund 2
237 Östersund 3
238 Nykvarn 4
239 Eslöv 2
240 Ystad 2
241 Västerås 3
242 Trollhättan 3
243 Timrå 2
244 Kungsbacka 4
245 Södertälje 3
246 Landskrona 3
247 Nynäshamn 2
248 Karlstad 3
249 Linköping 3
250 Håbo 4
251 Ale 4
252 Helsingborg 3
253 Kungälv 2
254 Lerum 4
255 Ekerö 4
256 Svedala 4
257 Kävlinge 4
258 Vellinge 4
259 Härryda 4
260 Österåker 4
261 Göteborg 3
262 Staffanstorp 4
263 Burlöv 4
264 Hammarö 4
265 Botkyrka 4
266 Värmdö 4
267 Uppsala 3
268 Sigtuna 4
269 Upplands-Bro 4
270 Malmö 3
271 Haninge 4
272 Partille 4
273 Salem 4
274 Knivsta 4
275 Vallentuna 4
276 Tyresö 4
277 Huddinge 4
278 Mölndal 4
279 Upplands Väsby 4
280 Lomma 4
281 Lund 4
282 Vaxholm 4
283 Järfälla 4
284 Stockholm 4
285 Sollentuna 4
286 Lidingö 4
287 Nacka 4
288 Täby 4
289 Danderyd 4
290 Sundbyberg 4
291 Solna 4

View file

@ -0,0 +1,291 @@
municipality,c6
Pajala,1
Vansbro,1
Norsjö,1
Årjäng,1
Strömsund,1
Övertorneå,1
Ovanåker,2
Torsby,1
Överkalix,1
Uppvidinge,2
Dorotea,1
Åsele,1
Sorsele,1
Ragunda,1
Malå,2
Bjurholm,3
Gällivare,1
Vindeln,2
Bengtsfors,2
Vilhelmina,1
Eda,2
Hultsfred,2
Jokkmokk,1
Älvdalen,1
Vetlanda,2
Älvsbyn,1
Hylte,2
Ånge,1
Högsby,3
Lycksele,1
Gislaved,2
Sävsjö,2
Robertsfors,3
Örnsköldsvik,1
Ydre,3
Vimmerby,2
Kramfors,1
Arjeplog,1
Tingsryd,2
Ljusdal,1
Hagfors,2
Gnosjö,2
Emmaboda,2
Tranemo,2
Storuman,1
Sollefteå,1
Arvidsjaur,1
Nordanstig,3
Markaryd,2
Gullspång,2
Kalix,1
Sunne,1
Bräcke,3
Berg,1
Ockelbo,3
Dals-Ed,2
Ödeshög,3
Ljungby,2
Nordmaling,3
Hällefors,2
Mellerud,3
Valdemarsvik,3
Piteå,1
Kiruna,1
Härjedalen,1
Kinda,3
Laxå,2
Vara,2
Torsås,3
Arvika,1
Mönsterås,2
Säffle,2
Färgelanda,3
Essunga,3
Askersund,2
Olofström,2
Lindesberg,2
Filipstad,2
Skinnskatteberg,2
Bollnäs,1
Västervik,1
Haparanda,1
Munkfors,2
Vaggeryd,2
Ljusnarsberg,2
Herrljunga,2
Oskarshamn,2
Svenljunga,3
Vingåker,3
Mora,2
Hudiksvall,1
Tanum,2
Smedjebacken,3
Skellefteå,1
Falköping,2
Värnamo,2
Söderhamn,1
Laholm,3
Östra Göinge,3
Töreboda,2
Hofors,2
Storfors,3
Tranås,2
Åmål,2
Malung-Sälen,1
Gotland,1
Nybro,2
Flen,2
Borgholm,2
Tidaholm,2
Ulricehamn,2
Ludvika,2
Ronneby,2
Aneby,3
Munkedal,3
Örkelljunga,3
Alvesta,3
Gagnef,3
Lessebo,3
Grums,3
Eksjö,2
Leksand,2
Strömstad,1
Nässjö,2
Hjo,2
Boxholm,3
Hedemora,2
Degerfors,3
Katrineholm,2
Rättvik,2
Östhammar,2
Orsa,2
Motala,2
Mark,2
Orust,3
Sölvesborg,3
Tierp,2
Finspång,2
Lysekil,2
Grästorp,3
Simrishamn,2
Avesta,2
Sotenäs,2
Mullsjö,3
Nora,2
Kungsör,3
Hörby,3
Åtvidaberg,2
Heby,3
Säter,3
Falkenberg,2
Hässleholm,2
Vårgårda,3
Karlsborg,2
Götene,3
Tomelilla,3
Krokom,3
Sandviken,2
Sjöbo,3
Osby,3
Kristianstad,4
Sala,2
Halmstad,4
Karlshamn,2
Bromölla,3
Tibro,3
Boden,4
Karlskrona,4
Norberg,3
Varberg,4
Lekeberg,3
Lilla Edet,3
Köping,2
Hallsberg,3
Älvkarleby,3
Eskilstuna,4
Mörbylånga,3
Forshaga,3
Lidköping,3
Svalöv,3
Öckerö,3
Vännäs,3
Perstorp,3
Tjörn,3
Kristinehamn,3
Söderköping,3
Falun,4
Arboga,3
Klippan,3
Kil,3
Vadstena,3
Surahammar,3
Hallstahammar,3
Jönköping,4
Mjölby,3
Älmhult,3
Gnesta,3
Mariestad,3
Åre,4
Bjuv,3
Härnösand,4
Karlskoga,4
Borås,4
Norrtälje,4
Åstorp,3
Skurup,3
Skara,3
Norrköping,4
Habo,3
Växjö,4
Båstad,3
Fagersta,4
Höör,3
Gävle,4
Borlänge,4
Skövde,4
Örebro,4
Kumla,3
Höganäs,3
Ängelholm,3
Luleå,4
Nyköping,4
Uddevalla,3
Kalmar,4
Trosa,3
Umeå,4
Strängnäs,3
Trelleborg,3
Enköping,3
Vänersborg,3
Oxelösund,4
Bollebygd,3
Alingsås,3
Sundsvall,4
Stenungsund,3
Östersund,4
Nykvarn,5
Eslöv,3
Ystad,3
Västerås,4
Trollhättan,4
Timrå,3
Kungsbacka,5
Södertälje,4
Landskrona,4
Nynäshamn,3
Karlstad,4
Linköping,4
Håbo,5
Ale,5
Helsingborg,4
Kungälv,3
Lerum,5
Ekerö,5
Svedala,5
Kävlinge,5
Vellinge,5
Härryda,5
Österåker,5
Göteborg,4
Staffanstorp,5
Burlöv,5
Hammarö,5
Botkyrka,5
Värmdö,5
Uppsala,4
Sigtuna,5
Upplands-Bro,5
Malmö,4
Haninge,5
Partille,5
Salem,5
Knivsta,5
Vallentuna,5
Tyresö,5
Huddinge,5
Mölndal,5
Upplands Väsby,5
Lomma,5
Lund,5
Vaxholm,5
Järfälla,5
Stockholm,6
Sollentuna,6
Lidingö,6
Nacka,6
Täby,6
Danderyd,6
Sundbyberg,6
Solna,6
1 municipality c6
2 Pajala 1
3 Vansbro 1
4 Norsjö 1
5 Årjäng 1
6 Strömsund 1
7 Övertorneå 1
8 Ovanåker 2
9 Torsby 1
10 Överkalix 1
11 Uppvidinge 2
12 Dorotea 1
13 Åsele 1
14 Sorsele 1
15 Ragunda 1
16 Malå 2
17 Bjurholm 3
18 Gällivare 1
19 Vindeln 2
20 Bengtsfors 2
21 Vilhelmina 1
22 Eda 2
23 Hultsfred 2
24 Jokkmokk 1
25 Älvdalen 1
26 Vetlanda 2
27 Älvsbyn 1
28 Hylte 2
29 Ånge 1
30 Högsby 3
31 Lycksele 1
32 Gislaved 2
33 Sävsjö 2
34 Robertsfors 3
35 Örnsköldsvik 1
36 Ydre 3
37 Vimmerby 2
38 Kramfors 1
39 Arjeplog 1
40 Tingsryd 2
41 Ljusdal 1
42 Hagfors 2
43 Gnosjö 2
44 Emmaboda 2
45 Tranemo 2
46 Storuman 1
47 Sollefteå 1
48 Arvidsjaur 1
49 Nordanstig 3
50 Markaryd 2
51 Gullspång 2
52 Kalix 1
53 Sunne 1
54 Bräcke 3
55 Berg 1
56 Ockelbo 3
57 Dals-Ed 2
58 Ödeshög 3
59 Ljungby 2
60 Nordmaling 3
61 Hällefors 2
62 Mellerud 3
63 Valdemarsvik 3
64 Piteå 1
65 Kiruna 1
66 Härjedalen 1
67 Kinda 3
68 Laxå 2
69 Vara 2
70 Torsås 3
71 Arvika 1
72 Mönsterås 2
73 Säffle 2
74 Färgelanda 3
75 Essunga 3
76 Askersund 2
77 Olofström 2
78 Lindesberg 2
79 Filipstad 2
80 Skinnskatteberg 2
81 Bollnäs 1
82 Västervik 1
83 Haparanda 1
84 Munkfors 2
85 Vaggeryd 2
86 Ljusnarsberg 2
87 Herrljunga 2
88 Oskarshamn 2
89 Svenljunga 3
90 Vingåker 3
91 Mora 2
92 Hudiksvall 1
93 Tanum 2
94 Smedjebacken 3
95 Skellefteå 1
96 Falköping 2
97 Värnamo 2
98 Söderhamn 1
99 Laholm 3
100 Östra Göinge 3
101 Töreboda 2
102 Hofors 2
103 Storfors 3
104 Tranås 2
105 Åmål 2
106 Malung-Sälen 1
107 Gotland 1
108 Nybro 2
109 Flen 2
110 Borgholm 2
111 Tidaholm 2
112 Ulricehamn 2
113 Ludvika 2
114 Ronneby 2
115 Aneby 3
116 Munkedal 3
117 Örkelljunga 3
118 Alvesta 3
119 Gagnef 3
120 Lessebo 3
121 Grums 3
122 Eksjö 2
123 Leksand 2
124 Strömstad 1
125 Nässjö 2
126 Hjo 2
127 Boxholm 3
128 Hedemora 2
129 Degerfors 3
130 Katrineholm 2
131 Rättvik 2
132 Östhammar 2
133 Orsa 2
134 Motala 2
135 Mark 2
136 Orust 3
137 Sölvesborg 3
138 Tierp 2
139 Finspång 2
140 Lysekil 2
141 Grästorp 3
142 Simrishamn 2
143 Avesta 2
144 Sotenäs 2
145 Mullsjö 3
146 Nora 2
147 Kungsör 3
148 Hörby 3
149 Åtvidaberg 2
150 Heby 3
151 Säter 3
152 Falkenberg 2
153 Hässleholm 2
154 Vårgårda 3
155 Karlsborg 2
156 Götene 3
157 Tomelilla 3
158 Krokom 3
159 Sandviken 2
160 Sjöbo 3
161 Osby 3
162 Kristianstad 4
163 Sala 2
164 Halmstad 4
165 Karlshamn 2
166 Bromölla 3
167 Tibro 3
168 Boden 4
169 Karlskrona 4
170 Norberg 3
171 Varberg 4
172 Lekeberg 3
173 Lilla Edet 3
174 Köping 2
175 Hallsberg 3
176 Älvkarleby 3
177 Eskilstuna 4
178 Mörbylånga 3
179 Forshaga 3
180 Lidköping 3
181 Svalöv 3
182 Öckerö 3
183 Vännäs 3
184 Perstorp 3
185 Tjörn 3
186 Kristinehamn 3
187 Söderköping 3
188 Falun 4
189 Arboga 3
190 Klippan 3
191 Kil 3
192 Vadstena 3
193 Surahammar 3
194 Hallstahammar 3
195 Jönköping 4
196 Mjölby 3
197 Älmhult 3
198 Gnesta 3
199 Mariestad 3
200 Åre 4
201 Bjuv 3
202 Härnösand 4
203 Karlskoga 4
204 Borås 4
205 Norrtälje 4
206 Åstorp 3
207 Skurup 3
208 Skara 3
209 Norrköping 4
210 Habo 3
211 Växjö 4
212 Båstad 3
213 Fagersta 4
214 Höör 3
215 Gävle 4
216 Borlänge 4
217 Skövde 4
218 Örebro 4
219 Kumla 3
220 Höganäs 3
221 Ängelholm 3
222 Luleå 4
223 Nyköping 4
224 Uddevalla 3
225 Kalmar 4
226 Trosa 3
227 Umeå 4
228 Strängnäs 3
229 Trelleborg 3
230 Enköping 3
231 Vänersborg 3
232 Oxelösund 4
233 Bollebygd 3
234 Alingsås 3
235 Sundsvall 4
236 Stenungsund 3
237 Östersund 4
238 Nykvarn 5
239 Eslöv 3
240 Ystad 3
241 Västerås 4
242 Trollhättan 4
243 Timrå 3
244 Kungsbacka 5
245 Södertälje 4
246 Landskrona 4
247 Nynäshamn 3
248 Karlstad 4
249 Linköping 4
250 Håbo 5
251 Ale 5
252 Helsingborg 4
253 Kungälv 3
254 Lerum 5
255 Ekerö 5
256 Svedala 5
257 Kävlinge 5
258 Vellinge 5
259 Härryda 5
260 Österåker 5
261 Göteborg 4
262 Staffanstorp 5
263 Burlöv 5
264 Hammarö 5
265 Botkyrka 5
266 Värmdö 5
267 Uppsala 4
268 Sigtuna 5
269 Upplands-Bro 5
270 Malmö 4
271 Haninge 5
272 Partille 5
273 Salem 5
274 Knivsta 5
275 Vallentuna 5
276 Tyresö 5
277 Huddinge 5
278 Mölndal 5
279 Upplands Väsby 5
280 Lomma 5
281 Lund 5
282 Vaxholm 5
283 Järfälla 5
284 Stockholm 6
285 Sollentuna 6
286 Lidingö 6
287 Nacka 6
288 Täby 6
289 Danderyd 6
290 Sundbyberg 6
291 Solna 6

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -347,8 +347,6 @@ supp_idx <- which(colnames(tab_mat) %in% supp_labels)
# anywhere) — they break CA's supplementary projection.
zero_cols <- which(colSums(tab_mat) == 0)
if (length(zero_cols) > 0) {
cat("Dropping all-zero columns:",
paste(colnames(tab_mat)[zero_cols], collapse = ", "), "\n")
tab_mat <- tab_mat[, -zero_cols]
supp_idx <- which(colnames(tab_mat) %in% supp_labels)
}

View file

@ -0,0 +1,41 @@
# =============================================================================
# 05-clustering.R · AHC on the proportions_CA row scores
# =============================================================================
#
# Runs hierarchical clustering on the row coordinates of the proportions_CA
# to derive an empirical urban/rural typology of Swedish municipalities.
#
# We use FactoMineR::HCPC, which performs Ward's-method AHC on the principal
# coordinates and picks the cluster count from the largest inertia jump.
#
# Input:
# data/processed/proportions_CA.rds - CA result
#
# Outputs:
# data/processed/proportions_HCPC.rds - HCPC object (dendrogram, cuts,
# per-cluster descriptors)
# data/processed/cluster_assignment.csv - municipality, code, cluster
library(tidyverse)
library(FactoMineR)
afc <- read_rds("data/processed/proportions_CA.rds")
# Ward AHC on the first 5 principal axes (~85% of inertia). consol = FALSE
# skips the k-means refinement so the partition matches the dendrogram cut.
hcpc <- HCPC(afc, nb.clust = -1, consol = FALSE, graph = FALSE, min = 3, max = 6)
cluster_df <- hcpc$data.clust |>
rownames_to_column("municipality") |>
select(municipality, cluster = clust) |>
mutate(cluster = as.integer(as.character(cluster)))
write_rds(hcpc, "data/processed/proportions_HCPC.rds")
write_csv(cluster_df, "data/processed/cluster_assignment.csv")
cat("\nCluster sizes:\n"); print(table(cluster_df$cluster))
cat("\nPer-cluster paragons (most typical municipalities):\n")
for (i in seq_along(hcpc$desc.ind$para)) {
cat("\nCluster", i, ":\n")
print(head(hcpc$desc.ind$para[[i]], 5))
}

Binary file not shown.

View file

@ -0,0 +1,446 @@
---
title: "An empirical urban--rural typology of Swedish municipalities"
subtitle: "Correspondence analysis and hierarchical clustering on the 2022 sampling"
date: today
format:
pdf:
toc: true
number-sections: true
fig-pos: "H"
geometry: margin=2.5cm
fontsize: 11pt
execute:
echo: false
warning: false
message: false
---
```{r rootdir, include=FALSE}
knitr::opts_knit$set(root.dir = rprojroot::find_root(rprojroot::has_dir("data")))
```
```{r setup}
library(tidyverse)
library(FactoMineR)
library(factoextra)
library(ggrepel)
library(knitr)
library(kableExtra)
library(showtext)
font_add_google("Source Sans 3", "source_sans_3")
showtext_auto()
theme_set(theme_minimal(base_size = 10, base_family = "source_sans_3"))
afc <- read_rds("data/processed/proportions_CA.rds")
hcpc <- read_rds("data/processed/proportions_HCPC.rds")
clusters <- read_csv("data/processed/cluster_assignment.csv", show_col_types = FALSE)
# County labels for context
county_names <- c(
"01" = "Stockholm", "03" = "Uppsala", "04" = "Södermanland",
"05" = "Östergötland", "06" = "Jönköping", "07" = "Kronoberg",
"08" = "Kalmar", "09" = "Gotland", "10" = "Blekinge",
"12" = "Skåne", "13" = "Halland", "14" = "Västra Götaland",
"17" = "Värmland", "18" = "Örebro", "19" = "Västmanland",
"20" = "Dalarna", "21" = "Gävleborg", "22" = "Västernorrland",
"23" = "Jämtland", "24" = "Västerbotten", "25" = "Norrbotten"
)
# Custom cluster labels and palette derived from the analysis below
cluster_labels <- c(
"1" = "Industrial-rural towns",
"2" = "Peri-rural commuter belt",
"3" = "Regional service centres",
"4" = "Metropolitan & knowledge hubs"
)
cluster_palette <- c(
"1" = "#D7A86E",
"2" = "#7CB07C",
"3" = "#6FA8DC",
"4" = "#C2738B"
)
clusters <- clusters |>
mutate(cluster_label = cluster_labels[as.character(cluster)])
```
# What the analysis does
Sweden's 290 municipalities are routinely sorted into urban and rural by administrative or population-size rules. These categories are convenient but external to the data. The work reported here builds a typology *from* the data: we look at how municipalities differ on a wide set of structural variables (education, employment, housing, mobility, demography) and let those differences group municipalities together.
There are two steps. First, a correspondence analysis (CA) places every municipality in a low-dimensional space where distance reflects how similar the municipalities are on the active variables. Second, a hierarchical clustering on that space (Ward's method) cuts the cloud into a small number of groups. The (preliminary) result is a four-cluster typology that runs from industrial and rural municipalities at one end to wealthy metropolitan suburbs and knowledge hubs at the other.
# Inputs and preparation
The data come from Statistics Sweden via the project's 2022 sampling. Six variable blocks are used as **active**:
- **Education:** Four levels of attainment (primary/lower secondary through post-graduate)
- **Employment:** 16 activity sectors (agriculture through arts & recreation)
- **Housing:** Rented, tenant-owned, and owner-occupied dwellings
- **Workplace:** Commuters in, commuters out, working & living in the same municipality
- **Migration:** Inmigrations and outmigrations
- **Demography:** Retirees and number of localities
Two further blocks are projected as **supplementary**:
- **Educational provision:** Counts of preschool, primary, secondary, adult and higher-education units by ownership (total, public, private)
- **Opinion:** Survey-based satisfaction on preschool, elementary and high school
## Two adjustments to the previous CA
A plain CA on the raw counts puts Stockholm, Göteborg and Malmö far out on the first axis simply because they are large. The axis becomes a size axis and tells us little about *how* municipalities differ. Two adjustments fix this:
1. **Block normalisation.** Within each variable block, every municipality is rescaled so that its block-total is the same constant. After this step every municipality contributes the same row mass to the CA, and every block contributes the same total weight. The axes are no longer dominated by absolute counts.
2. **Provision as a per-capita rate.** The supplementary provision counts are divided by a population proxy (the row sum of the education block) so that "five universities in Stockholm" and "one university in Skellefteå" are compared on the rate scale rather than the raw count scale. Without this step rare types like *university* or *Sami school* are tugged to extreme positions and clutter the biplot (they still are, but not as much).
## A note on the demography block
Two of the variables we wanted to use, *Number of retirees* and *Number of localities*, do not belong to any of the natural topics described above. They are stand-alone counts that, on their own, would simply scale with municipality size.
The normalisation step we use needs at least **two variables** in a block. With only one variable, the rescaling "divide each row by its own block total" turns every value into the same constant, and the variable carries no information into the CA. So a one-variable block disappears from the analysis.
We had three options for retirees and localities:
- **Drop them.** They would not influence the result at all. We would lose information that is meaningful to the urbanrural question (an older population, a denser locality structure).
- **Attach each to an existing topic.** There is no natural home: retirees are not "employment" and localities are not "housing".
- **Group the two together into their own block** ("Demography"). Each municipality's retirees and localities are rescaled so that the two of them add up to the same constant, just like every other block.
I went with the third option for now. The price is that the resulting share "retirees share of (retirees + localities)" mixes units (people and places), so it is not a tidy proportion in the way "share of housing that is rented" is. The benefit is that the *contrast* it captures is meaningful: a municipality with many retirees per locality (an ageing population concentrated in a few settlements) sits on one side, and one with many localities per resident retiree (a population spread thinly across many small settlements) on the other. That contrast lines up with the urbanrural gradient we care about, and so it's kept (for now).
# The space of municipalities
```{r tbl-eig}
#| tbl-cap: "Eigenvalues of the first five CA dimensions. Dimensions 1 and 2 together account for two-thirds of the variability."
eig <- as.data.frame(afc$eig[1:5, ]) |>
rownames_to_column("Dimension") |>
transmute(
Dimension = str_replace(Dimension, "^dim ", "Dim "),
Eigenvalue = round(eigenvalue, 4),
`% inertia` = round(`percentage of variance`, 1),
`Cumulative %` = round(`cumulative percentage of variance`, 1)
)
kbl(eig, booktabs = TRUE, linesep = "") |>
kable_styling(font_size = 9, latex_options = "hold_position")
```
```{r fig-biplot}
#| fig-width: 9
#| fig-height: 6.5
#| fig-cap: "CA biplot, first two dimensions. Municipalities (dots) are coloured by their cluster (see next section). The most contributive active variables are shown in red."
row_df <- as.data.frame(afc$row$coord[, 1:2]) |>
rownames_to_column("municipality") |>
left_join(clusters, by = "municipality")
contribs <- as.data.frame(afc$col$contrib) |>
rownames_to_column("variable") |>
mutate(total = `Dim 1` + `Dim 2`) |>
arrange(desc(total)) |>
head(15)
col_df <- as.data.frame(afc$col$coord[, 1:2]) |>
rownames_to_column("variable") |>
filter(variable %in% contribs$variable)
label_munis <- c("Stockholm", "Göteborg", "Malmö", "Uppsala", "Lund", "Umeå",
"Linköping", "Solna", "Danderyd", "Kiruna", "Gotland",
"Knivsta", "Falköping", "Tomelilla")
ggplot() +
geom_hline(yintercept = 0, linetype = "dashed", colour = "grey60") +
geom_vline(xintercept = 0, linetype = "dashed", colour = "grey60") +
geom_point(data = row_df, aes(`Dim 1`, `Dim 2`, colour = cluster_label),
alpha = 0.7, size = 1.8) +
geom_text_repel(data = row_df |> filter(municipality %in% label_munis),
aes(`Dim 1`, `Dim 2`, label = municipality),
size = 2.7, colour = "grey20", family = "source_sans_3",
max.overlaps = 30, segment.size = 0.2) +
geom_point(data = col_df, aes(`Dim 1`, `Dim 2`),
shape = 17, colour = "firebrick", size = 2) +
geom_text_repel(data = col_df, aes(`Dim 1`, `Dim 2`, label = variable),
colour = "firebrick", size = 2.7, family = "source_sans_3",
max.overlaps = 30, segment.size = 0.2) +
scale_colour_manual(values = cluster_palette |> set_names(cluster_labels),
name = "Cluster") +
labs(
x = paste0("Dim 1 (", round(afc$eig[1, 2], 1), "%)"),
y = paste0("Dim 2 (", round(afc$eig[2, 2], 1), "%)")
) +
theme(legend.position = "bottom")
```
**Dim 1 (`r round(afc$eig[1, 2], 1)`%)** is a rural-to-urban axis. To the left sit modalities tied to extractive and traditional employment (agriculture, mining & manufacturing), owner-occupied housing, and primary or upper-secondary education; the municipalities there are northern, industrial or sparsely populated (e.g. Kiruna, Gotland, Falköping). To the right sit modalities tied to the knowledge economy (IT & communication, finance, professional services), post-secondary and post-graduate attainment, and tenant-owned (apartment) housing; the right pole is anchored by Solna, Stockholm, Sundbyberg, Lund and Uppsala.
**Dim 2 (`r round(afc$eig[2, 2], 1)`%)** distinguishes municipalities by how their residents relate to the labour market. The top of the axis is anchored by "Working & living in the municipality"; self-contained labour markets, often regional centres like Göteborg, Malmö, Umeå and Uppsala. The bottom is dominated by "Commuters out"; residential municipalities whose population works elsewhere, typically the Stockholm-region suburbs (Knivsta, Salem, Staffanstorp).
# A first attempt at an empirical typology: four clusters
Hierarchical clustering (Ward) on the CA row coordinates yields four clusters; the gap between four and three clusters in the inertia profile is large, while five clusters add only a small refinement.
```{r fig-dendrogram}
#| fig-width: 9
#| fig-height: 4
#| fig-cap: "Ward dendrogram on the CA coordinates. The cut into four clusters falls where the merge cost rises sharply."
tree <- hcpc$call$t$tree
h_max <- max(tree$height)
fviz_dend(tree, k = 4, show_labels = FALSE,
rect = TRUE, rect_border = unname(cluster_palette),
rect_fill = TRUE, k_colors = unname(cluster_palette),
main = "", ylab = "Merge distance (Ward)") +
coord_cartesian(ylim = c(0, h_max * 1.05)) +
guides(linewidth = "none") +
theme(plot.title = element_blank())
```
```{r tbl-sizes}
#| tbl-cap: "Cluster sizes and labels."
clusters |>
count(cluster, cluster_label, name = "n") |>
mutate(`%` = round(100 * n / sum(n), 1)) |>
transmute(Cluster = cluster, Label = cluster_label,
`Municipalities` = n, `Share (%)` = `%`) |>
kbl(booktabs = TRUE, linesep = "") |>
kable_styling(font_size = 9, latex_options = "hold_position")
```
## Cluster profiles
For every cluster we list the variables whose mean inside the cluster departs most strongly from the national mean (`v.test` statistic from `HCPC`). A high positive value means the variable is *over*-represented in the cluster.
```{r}
#| results: asis
desc_table <- function(cluster_id, n_show = 6) {
d <- hcpc$desc.var[[as.character(cluster_id)]] |>
as.data.frame(check.names = FALSE) |>
rownames_to_column("Variable") |>
arrange(desc(v.test)) |>
head(n_show) |>
transmute(
Variable = str_replace_all(Variable, "\\.", " "),
`Share in cluster (%)` = round(`Intern %`, 2),
`Share overall (%)` = round(`glob %`, 2),
`v.test` = round(v.test, 1)
)
d
}
paragon_list <- function(cluster_id, n_show = 8) {
paste(names(head(hcpc$desc.ind$para[[as.character(cluster_id)]], n_show)),
collapse = ", ")
}
for (k in 1:4) {
cat("\n\n### Cluster ", k, ": ", cluster_labels[as.character(k)], " \n\n", sep = "")
cat("**Typical municipalities** (closest to the cluster centre): *",
paragon_list(k), ".*\n\n", sep = "")
print(
kbl(desc_table(k), booktabs = TRUE, linesep = "",
caption = paste0("Top over-represented variables, cluster ", k, ".")) |>
kable_styling(font_size = 9, latex_options = c("hold_position", "scale_down"))
)
}
```
## What each cluster looks like
```{r fig-cluster-biplot}
#| fig-width: 9
#| fig-height: 6.5
#| fig-cap: "Cluster centroids on the CA plane. The arrows give an at-a-glance view of where each cluster sits in the rural-urban (Dim 1) and self-contained-vs-commuter (Dim 2) plane."
centroids <- row_df |>
group_by(cluster_label) |>
summarise(
`Dim 1` = mean(`Dim 1`),
`Dim 2` = mean(`Dim 2`),
.groups = "drop"
)
ggplot(row_df, aes(`Dim 1`, `Dim 2`, colour = cluster_label)) +
geom_hline(yintercept = 0, linetype = "dashed", colour = "grey70") +
geom_vline(xintercept = 0, linetype = "dashed", colour = "grey70") +
geom_point(alpha = 0.45, size = 1.6) +
stat_ellipse(level = 0.7, linewidth = 0.6) +
geom_point(data = centroids, size = 4, shape = 18, colour = "black") +
geom_label_repel(data = centroids, aes(label = cluster_label),
fill = "white", colour = "black",
family = "source_sans_3", size = 3.2,
label.size = 0.2) +
scale_colour_manual(values = cluster_palette |> set_names(cluster_labels),
guide = "none") +
labs(x = paste0("Dim 1 (", round(afc$eig[1, 2], 1), "%)"),
y = paste0("Dim 2 (", round(afc$eig[2, 2], 1), "%)"))
```
#### Cluster 1: Industrial-rural towns. {.unnumbered}
The largest cluster (`r sum(clusters$cluster == 1)` municipalities). These are self-contained, often Norrland or central-Sweden municipalities. Residents tend to work and live in the same place, employment is concentrated in mining, manufacturing and agriculture, housing is overwhelmingly owner-occupied, and the typical educational ceiling is upper secondary. Kiruna and Gotland sit at the cluster's far edge.
#### Cluster 2: Peri-rural commuter belt. {.unnumbered}
`r sum(clusters$cluster == 2)` municipalities. Smaller southern and central rural municipalities (Tomelilla, Osby, Klippan, Sölvesborg) where many residents commute out to a nearby labour market. Owner-occupied housing dominates, construction and agriculture are visible employment sectors, and survey opinions of local high schools tend to be *worse* than the national average. Consistent with a thin local educational offer that pushes choices elsewhere.
#### Cluster 3: Regional service centres. {.unnumbered}
`r sum(clusters$cluster == 3)` municipalities, including Göteborg, Malmö, Umeå, Uppsala, Linköping, Kalmar, Borås, Växjö and Gävle. They share the markers of a mid-sized regional city: substantial rented and tenant-owned housing, residents who work where they live, public administration, post-secondary attainment, and average satisfaction scores on local services. These are Sweden's "self-contained" mid-tier cities.
#### Cluster 4: Metropolitan and knowledge hubs. {.unnumbered}
`r sum(clusters$cluster == 4)` municipalities, mostly Stockholm-county suburbs (Huddinge, Tyresö, Knivsta, Sundbyberg, Solna, Danderyd, Lidingö, Täby, Nacka) plus Stockholm and Lund. Outbound commuting, finance, IT, professional services, post-secondary and post-graduate attainment all surge above the national mean; tenant-owned (apartment) housing is the norm. This cluster captures both the inner-city core of the Stockholm region and the wealthy residential suburbs that depend on it.
## Geography of the clusters
```{r fig-county}
#| fig-width: 9
#| fig-height: 5.5
#| fig-cap: "Cluster composition by county. Counties are ordered roughly south to north. Cluster 1 (industrial-rural) and 2 (peri-rural) dominate outside the metropolitan areas; cluster 4 (metro & knowledge hubs) is overwhelmingly Stockholm-, Uppsala- and Skåne-based; cluster 3 (regional centres) is spread thinly across most counties."
county_order <- c(
"Skåne", "Blekinge", "Halland", "Kronoberg", "Kalmar", "Gotland",
"Jönköping", "Östergötland", "Södermanland", "Västra Götaland",
"Örebro", "Västmanland", "Stockholm", "Uppsala", "Dalarna", "Värmland",
"Gävleborg", "Västernorrland", "Jämtland", "Västerbotten", "Norrbotten"
)
panel_raw <- readxl::read_excel("data/Municipalities_db_2.xlsx",
col_types = "text", n_max = 290) |>
transmute(municipality, code = str_pad(code, 4, "left", "0"))
clusters_geo <- clusters |>
left_join(panel_raw, by = "municipality") |>
mutate(county = county_names[str_sub(code, 1, 2)]) |>
filter(!is.na(county))
clusters_geo |>
count(county, cluster_label) |>
mutate(county = factor(county, levels = county_order)) |>
ggplot(aes(county, n, fill = cluster_label)) +
geom_col(position = "fill") +
scale_fill_manual(values = cluster_palette |> set_names(cluster_labels),
name = "Cluster") +
scale_y_continuous(labels = scales::percent, expand = c(0, 0)) +
labs(x = NULL, y = "Share of municipalities") +
theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 8),
legend.position = "bottom")
```
# Takeaways
The four clusters lay out a coherent rural-to-urban gradient that the standard "urban / rural" dichotomy hides. The biggest empirical break is not between metro and non-metro but between two kinds of rural area: industrial-rural towns with their own labour market (Cluster 1) versus peri-rural municipalities that depend on outbound commuting (Cluster 2). At the urban end, the data also separate two kinds of city: regional service centres that work as self-contained labour markets (Cluster 3) and metropolitan-region municipalities tied to the knowledge economy (Cluster 4).
A second observation is that the second axis--self-contained labour market vs. outbound-commuter base--matters as much for cluster membership as the first. Sweden's "wealthy suburb" municipalities and its mid-sized university cities sit on the same (right) side of the rural-urban axis but on opposite sides of the labour-market axis, and the clustering picks that distinction up cleanly.
The typology is a starting point: a four-cluster cut over-aggregates Stockholm, Solna and Sundbyberg with the surrounding affluent suburbs, and it pools the remote Norrland municipalities with the central industrial towns. Cutting the same tree at six clusters splits both of those merges; the next section shows that finer view.
# An optional finer cut: six clusters
Cutting the Ward tree at six clusters keeps the two middle clusters from the four-cluster cut (the peri-rural commuter belt and the regional service centres) and splits the other two:
- The **industrial-rural towns** divide into **northern/remote** municipalities (Kiruna, Gotland, Piteå, Skellefteå) and **central/southern industrial** towns (Falköping, Lindesberg, Hedemora).
- The **metropolitan & knowledge hubs** divide into the **affluent suburbs and university satellites** (Lund, Mölndal, Partille, Huddinge, Knivsta, Tyresö, Kungsbacka, ...) and a small **inner Stockholm core** (Stockholm, Solna, Sundbyberg, Danderyd, Lidingö, Täby, Nacka, Sollentuna).
```{r setup-6}
#| include: false
hcpc6 <- read_rds("data/processed/proportions_HCPC_6.rds")
clusters6 <- read_csv("data/processed/cluster_assignment_6.csv",
show_col_types = FALSE) |>
rename(cluster = c6)
cluster_labels_6 <- c(
"1" = "Northern & remote",
"2" = "Central industrial towns",
"3" = "Peri-rural commuter belt",
"4" = "Regional service centres",
"5" = "Affluent suburbs & university satellites",
"6" = "Inner Stockholm core"
)
cluster_palette_6 <- c(
"1" = "#B07F4F",
"2" = "#D7A86E",
"3" = "#7CB07C",
"4" = "#6FA8DC",
"5" = "#C2738B",
"6" = "#7A3A4F"
)
clusters6 <- clusters6 |>
mutate(cluster_label = cluster_labels_6[as.character(cluster)])
```
```{r tbl-sizes-6}
#| tbl-cap: "Six-cluster cut: cluster sizes and labels."
clusters6 |>
count(cluster, cluster_label, name = "n") |>
mutate(`%` = round(100 * n / sum(n), 1)) |>
transmute(Cluster = cluster, Label = cluster_label,
`Municipalities` = n, `Share (%)` = `%`) |>
kbl(booktabs = TRUE, linesep = "") |>
kable_styling(font_size = 9, latex_options = "hold_position")
```
```{r fig-biplot-6}
#| fig-width: 9
#| fig-height: 6.5
#| fig-cap: "CA biplot, six-cluster cut. The two splits relative to the four-cluster view cuts the cloud out along Dim 1: the northern/remote group sits further left than the central industrial towns, and the inner Stockholm core sits further right than the suburban ring."
row_df6 <- as.data.frame(afc$row$coord[, 1:2]) |>
rownames_to_column("municipality") |>
left_join(clusters6, by = "municipality")
label_munis_6 <- c("Stockholm", "Solna", "Sundbyberg", "Danderyd", "Lidingö",
"Lund", "Uppsala", "Göteborg", "Malmö", "Umeå", "Linköping",
"Knivsta", "Partille", "Mölndal",
"Kiruna", "Gotland", "Piteå", "Skellefteå",
"Falköping", "Lindesberg", "Tomelilla")
ggplot(row_df6, aes(`Dim 1`, `Dim 2`, colour = cluster_label)) +
geom_hline(yintercept = 0, linetype = "dashed", colour = "grey60") +
geom_vline(xintercept = 0, linetype = "dashed", colour = "grey60") +
geom_point(alpha = 0.75, size = 1.8) +
geom_text_repel(data = row_df6 |> filter(municipality %in% label_munis_6),
aes(label = municipality),
size = 2.7, colour = "grey20", family = "source_sans_3",
max.overlaps = 30, segment.size = 0.2) +
scale_colour_manual(values = cluster_palette_6 |> set_names(cluster_labels_6),
name = "Cluster") +
labs(
x = paste0("Dim 1 (", round(afc$eig[1, 2], 1), "%)"),
y = paste0("Dim 2 (", round(afc$eig[2, 2], 1), "%)")
) +
theme(legend.position = "bottom")
```
## What each new sub-cluster looks like
```{r}
#| results: asis
desc_table_6 <- function(cluster_id, n_show = 6) {
hcpc6$desc.var[[as.character(cluster_id)]] |>
as.data.frame(check.names = FALSE) |>
rownames_to_column("Variable") |>
arrange(desc(v.test)) |>
head(n_show) |>
transmute(
Variable = str_replace_all(Variable, "\\.", " "),
`Share in cluster (%)` = round(`Intern %`, 2),
`Share overall (%)` = round(`glob %`, 2),
`v.test` = round(v.test, 1)
)
}
paragon_list_6 <- function(cluster_id, n_show = 8) {
paste(names(head(hcpc6$desc.ind$para[[as.character(cluster_id)]], n_show)),
collapse = ", ")
}
for (k in 1:6) {
cat("\n\n### Cluster ", k, ": ", cluster_labels_6[as.character(k)], " \n\n", sep = "")
cat("**Typical municipalities**: *", paragon_list_6(k), ".*\n\n", sep = "")
print(
kbl(desc_table_6(k), booktabs = TRUE, linesep = "",
caption = paste0("Top over-represented variables, six-cluster cut, cluster ", k, ".")) |>
kable_styling(font_size = 9, latex_options = c("hold_position", "scale_down"))
)
}
```
## Reading the two splits
#### North vs. central industrial. {.unnumbered}
Both subgroups inherit the rural-industrial profile of the four-cluster cut (owner-occupied housing, upper-secondary education, working and living in the same municipality). The northern group is distinguished by an even stronger weight of agriculture/forestry/fishing, adult education (komvux) and preschool-class infrastructure. These are sparsely populated municipalities that have to provide a full educational service on their own at every age. The central group keeps mining & manufacturing as its single strongest difference. These are old industrial towns rather than remote rural ones.
#### Suburban ring vs. inner Stockholm core. {.unnumbered}
The suburban/university group (31 municipalities) is dominated by outbound commuters, post-secondary attainment and tenant-owned housing. These are residential satellites whose labour markets sit elsewhere. The inner core (8 municipalities) tightens the same profile much further: apartment housing, IT and finance employment, and inbound commuting all jump to extreme levels (several `v.test = Inf`). The split is meaningful because Stockholm, Solna, Sundbyberg and Lidingö are *destinations* in the commuting network, while Knivsta, Partille and Staffanstorp are *origins*. The four-cluster cut treats them as one population because they are similar relative to the rest of Sweden, but they sit at the two ends of the metropolitan labour market.