New recode tool
Microdata.no now has a new tool that simplifies larger recode operations.
In microdata.no you can recode both numeric and alphanumeric variables. Users can freely define their own ranges and rules.
In some situations it is useful to base recode rules on official classifications and/or reuse well defined correspondence tables when recoding.
In script-mode you can now use a new tool for recoding that allows you to upload correspondence tables in CSV-format, and that generates recode
-expressions based upon the uploaded table. You then paste the generated expression into your script.
The illustration below shows where to launch the CSV recode tool.
Statistics Norway maintains a service KLASS (https://www.ssb.no/klass/) where you can find both classifications, code lists and correspondence tables in CSV-format.
The illustrated example above shows a recode expression based upon KLASS’ correspondance table from Municipalities 2020 to Centrality 2020, and generated the following recode expression that may be pasted into a script:
recode variable ('0301' '3020' '3024' '3027' '3029' '3030' = '01' 'Sentralitet: 1 (925-1000) - høy') ('1103' '1108' '3002' '3003' '3004' '3005' '3019' '3021' '3022' '3025' '3031' '3032' '3033' '3049' '3403' '3801' '3803' '4601' '5001' = '02' 'Sentralitet: 2 (870-924)') ('1106' '1120' '1121' '1122' '1124' '1127' '1507' '1804' '3001' '3006' '3007' '3014' '3015' '3016' '3017' '3018' '3023' '3026' '3028' '3034' '3035' '3036' '3038' '3047' '3048' '3053' '3054' '3401' '3405' '3407' '3411' '3412' '3413' '3420' '3443' '3446' '3802' '3804' '3805' '3806' '3807' '3811' '3813' '4202' '4203' '4204' '4215' '4627' '5031' '5035' '5401' = '03' 'Sentralitet: 3 (775-869)') ('1101' '1114' '1119' '1130' '1146' '1149' '1505' '1506' '1516' '1517' '1520' '1528' '1531' '1532' '1577' '1806' '1824' '1833' '1841' '1870' '3011' '3013' '3037' '3041' '3050' '3414' '3415' '3416' '3440' '3441' '3442' '3447' '3448' '3451' '3808' '3812' '3814' '3816' '3817' '4201' '4205' '4206' '4207' '4213' '4214' '4216' '4219' '4223' '4225' '4612' '4614' '4621' '4622' '4623' '4624' '4626' '4630' '4631' '4647' '5006' '5007' '5028' '5029' '5036' '5037' '5038' '5053' '5059' '5402' '5403' '5406' = '04' 'Sentralitet: 4 (670-774)') ('1111' '1112' '1135' '1145' '1160' '1515' '1525' '1535' '1539' '1547' '1554' '1557' '1560' '1563' '1566' '1579' '1813' '1820' '1840' '1860' '1865' '1866' '1868' '3012' '3039' '3040' '3042' '3043' '3044' '3045' '3046' '3051' '3417' '3418' '3419' '3421' '3422' '3427' '3428' '3430' '3435' '3436' '3437' '3438' '3439' '3449' '3450' '3452' '3453' '3815' '3818' '3819' '3820' '3821' '4211' '4212' '4217' '4218' '4226' '4227' '4228' '4602' '4611' '4613' '4615' '4617' '4618' '4625' '4628' '4632' '4640' '4643' '4649' '4650' '4651' '5021' '5022' '5025' '5027' '5032' '5034' '5045' '5047' '5054' '5055' '5057' '5061' '5405' '5411' '5416' '5418' '5419' '5421' '5428' '5437' '5444' = '05' 'Sentralitet: 5 (565-669)') ('1133' '1134' '1144' '1151' '1511' '1514' '1573' '1576' '1578' '1811' '1812' '1815' '1816' '1818' '1822' '1825' '1826' '1827' '1828' '1832' '1834' '1835' '1836' '1837' '1838' '1839' '1845' '1848' '1851' '1853' '1856' '1857' '1859' '1867' '1871' '1874' '1875' '3052' '3423' '3424' '3425' '3426' '3429' '3431' '3432' '3433' '3434' '3454' '3822' '3823' '3824' '3825' '4220' '4221' '4222' '4224' '4616' '4619' '4620' '4629' '4633' '4634' '4635' '4636' '4637' '4638' '4639' '4641' '4642' '4644' '4645' '4646' '4648' '5014' '5020' '5026' '5033' '5041' '5042' '5043' '5044' '5046' '5049' '5052' '5056' '5058' '5060' '5404' '5412' '5413' '5414' '5415' '5417' '5420' '5422' '5423' '5424' '5425' '5426' '5427' '5429' '5430' '5432' '5433' '5434' '5435' '5436' '5438' '5439' '5440' '5441' '5442' '5443' = '06' 'Sentralitet: 6 (0-564) - lav')