SlideShare a Scribd company logo
1 of 10
Download to read offline
Error detection for the statistics of external
trade in goods
10/18/2019
Garðar Páll Gíslason, gardar.gislason@hagstofa.is, Statistics Iceland
Violeta Calian, violeta.calian@hagstofa.is, Statistics Iceland
Auður Ólína Svavarsdóttir, audur.svavarsdottir@hagstofa.is, Statistics Iceland
Bryndís Bjarnadóttir, bryndis.bjarnadottir@hagstofa.is, Statistics Iceland
Kolbrún Ýr Jóhannsdóttir, kolbrun.johannsdottir@hagstofa.is, Statistics Iceland 1
The goal of our project
• to automatize the detection and correction of data errors to a larger
extent
• to provide up-to-date and flexible tools to the analysts and experts in
the subject matter
10/18/2019 Error detection for the statistics of external trade in goods 2
Production process of foreign trade statistic
• Data input and validation of the expected IT structural requirements
• Error detection and localization, by verifying content and statistical
consistency of data
• Error correction, which includes: data imputation and editing, both
automatic and interactive
• Advanced validation procedures
• Testing and assessment of validation rules and imputation methods
10/18/2019 Error detection for the statistics of external trade in goods 3
The repository of error detection rules
• Github:
• https://github.com/hagstofan/TranStoR/tree/master/examples
Sql rules= starting point: expert, older software, Eurostat
R rules = target: obtained by the new R-tool TranStoR
10/18/2019 Error detection for the statistics of external trade in goods 4
Translation to R
• Our rules are not difficult:
• id IN (SELECT id FROM DATABASE1 F JOIN DATABASE2 M ON M.EINK = F.EINK
AND M.TLSK=F.TLSK AND M.LAND=F.LAND WHERE (M.EINK ='M' AND ((CASE
ÞYNGD WHEN 0 THEN CIF_VERÐ ELSE CIF_VERÐ/ÞYNGD END)<(VM_M-VM_S)
OR (CASE ÞYNGD WHEN 0 THEN CIF_VERÐ ELSE CIF_VERÐ/ÞYNGD
END)>(VM_S+VM_M))) OR (M.EINK ='X' AND ((CASE ÞYNGD WHEN 0 THEN
FOB_VERÐ ELSE CIF_VERÐ/ÞYNGD END)<(VM_M-VM_S) OR (CASE ÞYNGD
WHEN 0 THEN FOB_VERÐ ELSE FOB_VERÐ/ÞYNGD END)>(VM_S+VM_M))))
10/18/2019 Error detection for the statistics of external trade in goods 5
Error detection tool
• The validate R-package and
companions +
the rules +
the data
• http: https://github.com/data-
cleaning
10/18/2019 Error detection for the statistics of external trade in goods 6
Future work
• Validatetools
• ValidatReports
• Validate
• Error correction: imputation package and decrease manual
work
10/18/2019 Error detection for the statistics of external trade in goods 7
Thank you!
externaltrade@statice.is
utanrikisverslun@hagstofa.is
10/18/2019 Error detection for the statistics of external trade in goods 8
Appendix: examples of rules
• fields which have NULL values or have values which do not belong to
pre-defined admissable sets
• outliers in unit prices when compared to their past 12 months values
• outliers in unit prices by comparing them with their past 12 months
values (19% of warnings in the old system)
10/18/2019 Error detection for the statistics of external trade in goods 9
Appendix: examples of rules
SQL
• FLOW=X
• FLOW is NULL
• FLOW IN (some vector)
10/18/2019 Error detection for the statistics of external trade in goods 10
R
• FLOW == X
• is.null(FLOW)=TRUE
• FLOW %in% c(some vector)

More Related Content

Similar to Error detection for the statistics of external trade in goods, Garðar Páll Gíslason, Violeta Calian, Auður Ólína Svavarsdóttir, Bryndís Bjarnadóttir and Kolbrún Ýr Jóhannsdóttir, Statistics Iceland

What is next for Agriculture Sector - July 2023.pptx
What is next for Agriculture Sector - July 2023.pptxWhat is next for Agriculture Sector - July 2023.pptx
What is next for Agriculture Sector - July 2023.pptx
paul young cpa, cga
 

Similar to Error detection for the statistics of external trade in goods, Garðar Páll Gíslason, Violeta Calian, Auður Ólína Svavarsdóttir, Bryndís Bjarnadóttir and Kolbrún Ýr Jóhannsdóttir, Statistics Iceland (20)

Robotic accounting igls2022 paper presentation
Robotic accounting igls2022 paper presentationRobotic accounting igls2022 paper presentation
Robotic accounting igls2022 paper presentation
 
Top Reporting Challenges facing both the Private and Public Sector.pptx
Top Reporting Challenges facing both the Private and Public Sector.pptxTop Reporting Challenges facing both the Private and Public Sector.pptx
Top Reporting Challenges facing both the Private and Public Sector.pptx
 
Better Public Safety Management using Analytics - September 2023.pptx
Better Public Safety Management using Analytics - September 2023.pptxBetter Public Safety Management using Analytics - September 2023.pptx
Better Public Safety Management using Analytics - September 2023.pptx
 
Sap sd online training classes in usa,uk,australia
Sap sd online training classes in usa,uk,australiaSap sd online training classes in usa,uk,australia
Sap sd online training classes in usa,uk,australia
 
Brexit webinar ABM 06Dec2018
Brexit webinar ABM 06Dec2018Brexit webinar ABM 06Dec2018
Brexit webinar ABM 06Dec2018
 
DataBench Virtual BenchLearning "Big Data - Benchmark your way to Excellent B...
DataBench Virtual BenchLearning "Big Data - Benchmark your way to Excellent B...DataBench Virtual BenchLearning "Big Data - Benchmark your way to Excellent B...
DataBench Virtual BenchLearning "Big Data - Benchmark your way to Excellent B...
 
CV1
CV1CV1
CV1
 
Cross-Border E-Commerce Strategy - WeChat E-Commerce & Cross-Border Payment S...
Cross-Border E-Commerce Strategy - WeChat E-Commerce & Cross-Border Payment S...Cross-Border E-Commerce Strategy - WeChat E-Commerce & Cross-Border Payment S...
Cross-Border E-Commerce Strategy - WeChat E-Commerce & Cross-Border Payment S...
 
AIS swot analysis
AIS swot analysis AIS swot analysis
AIS swot analysis
 
Fintech Belgium_Webinar 13: Healthy Financial / Covid-19: Home Working Chall...
 Fintech Belgium_Webinar 13: Healthy Financial / Covid-19: Home Working Chall... Fintech Belgium_Webinar 13: Healthy Financial / Covid-19: Home Working Chall...
Fintech Belgium_Webinar 13: Healthy Financial / Covid-19: Home Working Chall...
 
Retail Sales - Analysis - Australia - February 2022.pptx
Retail Sales - Analysis - Australia - February 2022.pptxRetail Sales - Analysis - Australia - February 2022.pptx
Retail Sales - Analysis - Australia - February 2022.pptx
 
Cross-Border E-Commerce Strategy - We Chat & O2O Marketing
Cross-Border E-Commerce Strategy - We Chat & O2O MarketingCross-Border E-Commerce Strategy - We Chat & O2O Marketing
Cross-Border E-Commerce Strategy - We Chat & O2O Marketing
 
Supply Chain and Analytics.pptx
Supply Chain and Analytics.pptxSupply Chain and Analytics.pptx
Supply Chain and Analytics.pptx
 
Understanding the impact of your fraud strategy
Understanding the impact of your fraud strategy Understanding the impact of your fraud strategy
Understanding the impact of your fraud strategy
 
Onno Maliepaard “Automation & Process Improvement Strategies”
Onno Maliepaard “Automation & Process Improvement Strategies”Onno Maliepaard “Automation & Process Improvement Strategies”
Onno Maliepaard “Automation & Process Improvement Strategies”
 
Public Safety - Policing - Canada - October 2017
Public Safety - Policing - Canada - October 2017Public Safety - Policing - Canada - October 2017
Public Safety - Policing - Canada - October 2017
 
Papersoft AP & AR invoice processing
Papersoft AP & AR invoice processingPapersoft AP & AR invoice processing
Papersoft AP & AR invoice processing
 
Transforming supply chain Harish Bawari - Hero MotoCorp May 2016
Transforming supply chain Harish Bawari - Hero MotoCorp May 2016Transforming supply chain Harish Bawari - Hero MotoCorp May 2016
Transforming supply chain Harish Bawari - Hero MotoCorp May 2016
 
Kiho presentation rus
Kiho presentation rusKiho presentation rus
Kiho presentation rus
 
What is next for Agriculture Sector - July 2023.pptx
What is next for Agriculture Sector - July 2023.pptxWhat is next for Agriculture Sector - July 2023.pptx
What is next for Agriculture Sector - July 2023.pptx
 

More from Tilastokeskus

More from Tilastokeskus (20)

Kasvoiko Suomen bruttokansantuote 2023? Yliaktuaari Samu Hakala, Tilastokeskus
Kasvoiko Suomen bruttokansantuote 2023? Yliaktuaari Samu Hakala, TilastokeskusKasvoiko Suomen bruttokansantuote 2023? Yliaktuaari Samu Hakala, Tilastokeskus
Kasvoiko Suomen bruttokansantuote 2023? Yliaktuaari Samu Hakala, Tilastokeskus
 
Miten rakentaminen, teollisuus ja palvelut kehittyivät? Yliaktuaari Eljas Tuo...
Miten rakentaminen, teollisuus ja palvelut kehittyivät? Yliaktuaari Eljas Tuo...Miten rakentaminen, teollisuus ja palvelut kehittyivät? Yliaktuaari Eljas Tuo...
Miten rakentaminen, teollisuus ja palvelut kehittyivät? Yliaktuaari Eljas Tuo...
 
Mitä tapahtui ulkomaankaupassa? Yliaktuaari Reetta Karinluoma, Tilastokeskus
Mitä tapahtui ulkomaankaupassa? Yliaktuaari Reetta Karinluoma, TilastokeskusMitä tapahtui ulkomaankaupassa? Yliaktuaari Reetta Karinluoma, Tilastokeskus
Mitä tapahtui ulkomaankaupassa? Yliaktuaari Reetta Karinluoma, Tilastokeskus
 
Millaisia muutoksia tapahtui yksityisessä kulutuksessa ja investoinneissa, yl...
Millaisia muutoksia tapahtui yksityisessä kulutuksessa ja investoinneissa, yl...Millaisia muutoksia tapahtui yksityisessä kulutuksessa ja investoinneissa, yl...
Millaisia muutoksia tapahtui yksityisessä kulutuksessa ja investoinneissa, yl...
 
13.2.2024 Datajournalismin pikakurssi, Tilastokeskus
13.2.2024 Datajournalismin pikakurssi, Tilastokeskus13.2.2024 Datajournalismin pikakurssi, Tilastokeskus
13.2.2024 Datajournalismin pikakurssi, Tilastokeskus
 
13.2.2024 Datajournalismin pikakurssi, Tilastokeskus
13.2.2024 Datajournalismin pikakurssi, Tilastokeskus13.2.2024 Datajournalismin pikakurssi, Tilastokeskus
13.2.2024 Datajournalismin pikakurssi, Tilastokeskus
 
13.2.2024 Datajournalismin pikakurssi, Tilastokeskus
13.2.2024 Datajournalismin pikakurssi, Tilastokeskus13.2.2024 Datajournalismin pikakurssi, Tilastokeskus
13.2.2024 Datajournalismin pikakurssi, Tilastokeskus
 
14.12.2023 Kiertotalous Suomessa, Tilastokeskus
14.12.2023 Kiertotalous Suomessa, Tilastokeskus14.12.2023 Kiertotalous Suomessa, Tilastokeskus
14.12.2023 Kiertotalous Suomessa, Tilastokeskus
 
14.12.2023 Kiertotalous Suomessa, Tilastokeskus
14.12.2023 Kiertotalous Suomessa, Tilastokeskus14.12.2023 Kiertotalous Suomessa, Tilastokeskus
14.12.2023 Kiertotalous Suomessa, Tilastokeskus
 
14.12.2023 Kiertotalous Suomessa, Tilastokeskus
14.12.2023 Kiertotalous Suomessa, Tilastokeskus14.12.2023 Kiertotalous Suomessa, Tilastokeskus
14.12.2023 Kiertotalous Suomessa, Tilastokeskus
 
14.12.2023 Kiertotalous Suomessa, Tilastokeskus
14.12.2023 Kiertotalous Suomessa, Tilastokeskus14.12.2023 Kiertotalous Suomessa, Tilastokeskus
14.12.2023 Kiertotalous Suomessa, Tilastokeskus
 
14.12.2023 Kiertotalous Suomessa, Tilastokeskus
14.12.2023 Kiertotalous Suomessa, Tilastokeskus14.12.2023 Kiertotalous Suomessa, Tilastokeskus
14.12.2023 Kiertotalous Suomessa, Tilastokeskus
 
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
 
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
 
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
 
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
 
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
 
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
21.11.2023 Talouden kokonaiskestävyyden mittaaminen, Tilastokeskus
 
TOL2025 - mikä muuttuu? Miten uudistus toteutettiin? Miten muutostarpeet Suom...
TOL2025 - mikä muuttuu? Miten uudistus toteutettiin? Miten muutostarpeet Suom...TOL2025 - mikä muuttuu? Miten uudistus toteutettiin? Miten muutostarpeet Suom...
TOL2025 - mikä muuttuu? Miten uudistus toteutettiin? Miten muutostarpeet Suom...
 
Lääkärien vuokratyö, Heli Udd, Tilastokeskus
Lääkärien vuokratyö, Heli Udd, TilastokeskusLääkärien vuokratyö, Heli Udd, Tilastokeskus
Lääkärien vuokratyö, Heli Udd, Tilastokeskus
 

Recently uploaded

VIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Artificial Intelligence in Philippine Local Governance: Challenges and Opport...
Artificial Intelligence in Philippine Local Governance: Challenges and Opport...Artificial Intelligence in Philippine Local Governance: Challenges and Opport...
Artificial Intelligence in Philippine Local Governance: Challenges and Opport...
CedZabala
 

Recently uploaded (20)

Zechariah Boodey Farmstead Collaborative presentation - Humble Beginnings
Zechariah Boodey Farmstead Collaborative presentation -  Humble BeginningsZechariah Boodey Farmstead Collaborative presentation -  Humble Beginnings
Zechariah Boodey Farmstead Collaborative presentation - Humble Beginnings
 
Just Call Vip call girls Wardha Escorts ☎️8617370543 Starting From 5K to 25K ...
Just Call Vip call girls Wardha Escorts ☎️8617370543 Starting From 5K to 25K ...Just Call Vip call girls Wardha Escorts ☎️8617370543 Starting From 5K to 25K ...
Just Call Vip call girls Wardha Escorts ☎️8617370543 Starting From 5K to 25K ...
 
Call Girls Nanded City Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Nanded City Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Nanded City Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Nanded City Call Me 7737669865 Budget Friendly No Advance Booking
 
Incident Command System xxxxxxxxxxxxxxxxxxxxxxxxx
Incident Command System xxxxxxxxxxxxxxxxxxxxxxxxxIncident Command System xxxxxxxxxxxxxxxxxxxxxxxxx
Incident Command System xxxxxxxxxxxxxxxxxxxxxxxxx
 
Lucknow 💋 Russian Call Girls Lucknow ₹7.5k Pick Up & Drop With Cash Payment 8...
Lucknow 💋 Russian Call Girls Lucknow ₹7.5k Pick Up & Drop With Cash Payment 8...Lucknow 💋 Russian Call Girls Lucknow ₹7.5k Pick Up & Drop With Cash Payment 8...
Lucknow 💋 Russian Call Girls Lucknow ₹7.5k Pick Up & Drop With Cash Payment 8...
 
Booking open Available Pune Call Girls Shukrawar Peth 6297143586 Call Hot In...
Booking open Available Pune Call Girls Shukrawar Peth  6297143586 Call Hot In...Booking open Available Pune Call Girls Shukrawar Peth  6297143586 Call Hot In...
Booking open Available Pune Call Girls Shukrawar Peth 6297143586 Call Hot In...
 
Call On 6297143586 Viman Nagar Call Girls In All Pune 24/7 Provide Call With...
Call On 6297143586  Viman Nagar Call Girls In All Pune 24/7 Provide Call With...Call On 6297143586  Viman Nagar Call Girls In All Pune 24/7 Provide Call With...
Call On 6297143586 Viman Nagar Call Girls In All Pune 24/7 Provide Call With...
 
Call On 6297143586 Yerwada Call Girls In All Pune 24/7 Provide Call With Bes...
Call On 6297143586  Yerwada Call Girls In All Pune 24/7 Provide Call With Bes...Call On 6297143586  Yerwada Call Girls In All Pune 24/7 Provide Call With Bes...
Call On 6297143586 Yerwada Call Girls In All Pune 24/7 Provide Call With Bes...
 
Election 2024 Presiding Duty Keypoints_01.pdf
Election 2024 Presiding Duty Keypoints_01.pdfElection 2024 Presiding Duty Keypoints_01.pdf
Election 2024 Presiding Duty Keypoints_01.pdf
 
Top Rated Pune Call Girls Wadgaon Sheri ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated  Pune Call Girls Wadgaon Sheri ⟟ 6297143586 ⟟ Call Me For Genuine S...Top Rated  Pune Call Girls Wadgaon Sheri ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated Pune Call Girls Wadgaon Sheri ⟟ 6297143586 ⟟ Call Me For Genuine S...
 
VIP Model Call Girls Kiwale ( Pune ) Call ON 8005736733 Starting From 5K to 2...
VIP Model Call Girls Kiwale ( Pune ) Call ON 8005736733 Starting From 5K to 2...VIP Model Call Girls Kiwale ( Pune ) Call ON 8005736733 Starting From 5K to 2...
VIP Model Call Girls Kiwale ( Pune ) Call ON 8005736733 Starting From 5K to 2...
 
Top Rated Pune Call Girls Hadapsar ⟟ 6297143586 ⟟ Call Me For Genuine Sex Se...
Top Rated  Pune Call Girls Hadapsar ⟟ 6297143586 ⟟ Call Me For Genuine Sex Se...Top Rated  Pune Call Girls Hadapsar ⟟ 6297143586 ⟟ Call Me For Genuine Sex Se...
Top Rated Pune Call Girls Hadapsar ⟟ 6297143586 ⟟ Call Me For Genuine Sex Se...
 
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...
The Most Attractive Pune Call Girls Handewadi Road 8250192130 Will You Miss T...
 
Night 7k to 12k Call Girls Service In Navi Mumbai 👉 BOOK NOW 9833363713 👈 ♀️...
Night 7k to 12k  Call Girls Service In Navi Mumbai 👉 BOOK NOW 9833363713 👈 ♀️...Night 7k to 12k  Call Girls Service In Navi Mumbai 👉 BOOK NOW 9833363713 👈 ♀️...
Night 7k to 12k Call Girls Service In Navi Mumbai 👉 BOOK NOW 9833363713 👈 ♀️...
 
VIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Bhavnagar 7001035870 Whatsapp Number, 24/07 Booking
 
Get Premium Balaji Nagar Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
Get Premium Balaji Nagar Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...Get Premium Balaji Nagar Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
Get Premium Balaji Nagar Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
 
Top Rated Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
Artificial Intelligence in Philippine Local Governance: Challenges and Opport...
Artificial Intelligence in Philippine Local Governance: Challenges and Opport...Artificial Intelligence in Philippine Local Governance: Challenges and Opport...
Artificial Intelligence in Philippine Local Governance: Challenges and Opport...
 
VIP Russian Call Girls in Indore Ishita 💚😋 9256729539 🚀 Indore Escorts
VIP Russian Call Girls in Indore Ishita 💚😋  9256729539 🚀 Indore EscortsVIP Russian Call Girls in Indore Ishita 💚😋  9256729539 🚀 Indore Escorts
VIP Russian Call Girls in Indore Ishita 💚😋 9256729539 🚀 Indore Escorts
 
Regional Snapshot Atlanta Aging Trends 2024
Regional Snapshot Atlanta Aging Trends 2024Regional Snapshot Atlanta Aging Trends 2024
Regional Snapshot Atlanta Aging Trends 2024
 

Error detection for the statistics of external trade in goods, Garðar Páll Gíslason, Violeta Calian, Auður Ólína Svavarsdóttir, Bryndís Bjarnadóttir and Kolbrún Ýr Jóhannsdóttir, Statistics Iceland

  • 1. Error detection for the statistics of external trade in goods 10/18/2019 Garðar Páll Gíslason, gardar.gislason@hagstofa.is, Statistics Iceland Violeta Calian, violeta.calian@hagstofa.is, Statistics Iceland Auður Ólína Svavarsdóttir, audur.svavarsdottir@hagstofa.is, Statistics Iceland Bryndís Bjarnadóttir, bryndis.bjarnadottir@hagstofa.is, Statistics Iceland Kolbrún Ýr Jóhannsdóttir, kolbrun.johannsdottir@hagstofa.is, Statistics Iceland 1
  • 2. The goal of our project • to automatize the detection and correction of data errors to a larger extent • to provide up-to-date and flexible tools to the analysts and experts in the subject matter 10/18/2019 Error detection for the statistics of external trade in goods 2
  • 3. Production process of foreign trade statistic • Data input and validation of the expected IT structural requirements • Error detection and localization, by verifying content and statistical consistency of data • Error correction, which includes: data imputation and editing, both automatic and interactive • Advanced validation procedures • Testing and assessment of validation rules and imputation methods 10/18/2019 Error detection for the statistics of external trade in goods 3
  • 4. The repository of error detection rules • Github: • https://github.com/hagstofan/TranStoR/tree/master/examples Sql rules= starting point: expert, older software, Eurostat R rules = target: obtained by the new R-tool TranStoR 10/18/2019 Error detection for the statistics of external trade in goods 4
  • 5. Translation to R • Our rules are not difficult: • id IN (SELECT id FROM DATABASE1 F JOIN DATABASE2 M ON M.EINK = F.EINK AND M.TLSK=F.TLSK AND M.LAND=F.LAND WHERE (M.EINK ='M' AND ((CASE ÞYNGD WHEN 0 THEN CIF_VERÐ ELSE CIF_VERÐ/ÞYNGD END)<(VM_M-VM_S) OR (CASE ÞYNGD WHEN 0 THEN CIF_VERÐ ELSE CIF_VERÐ/ÞYNGD END)>(VM_S+VM_M))) OR (M.EINK ='X' AND ((CASE ÞYNGD WHEN 0 THEN FOB_VERÐ ELSE CIF_VERÐ/ÞYNGD END)<(VM_M-VM_S) OR (CASE ÞYNGD WHEN 0 THEN FOB_VERÐ ELSE FOB_VERÐ/ÞYNGD END)>(VM_S+VM_M)))) 10/18/2019 Error detection for the statistics of external trade in goods 5
  • 6. Error detection tool • The validate R-package and companions + the rules + the data • http: https://github.com/data- cleaning 10/18/2019 Error detection for the statistics of external trade in goods 6
  • 7. Future work • Validatetools • ValidatReports • Validate • Error correction: imputation package and decrease manual work 10/18/2019 Error detection for the statistics of external trade in goods 7
  • 8. Thank you! externaltrade@statice.is utanrikisverslun@hagstofa.is 10/18/2019 Error detection for the statistics of external trade in goods 8
  • 9. Appendix: examples of rules • fields which have NULL values or have values which do not belong to pre-defined admissable sets • outliers in unit prices when compared to their past 12 months values • outliers in unit prices by comparing them with their past 12 months values (19% of warnings in the old system) 10/18/2019 Error detection for the statistics of external trade in goods 9
  • 10. Appendix: examples of rules SQL • FLOW=X • FLOW is NULL • FLOW IN (some vector) 10/18/2019 Error detection for the statistics of external trade in goods 10 R • FLOW == X • is.null(FLOW)=TRUE • FLOW %in% c(some vector)