How to get data

Đặt vấn đề

Để tìm được dữ liệu phục vụ cho vấn đề nghiêu cứu không phải là việc đơn giản, đối với những người mới tiếp cận với việc phân tích dữ liệu, đặc biệt là các bạn sinh viên thì việc này lại càng không đơn giản. Trong bài viết này tôi sẽ liệt kê một số trang web có cung cấp dữ liệu miễn phí để giúp việc tìm kiếm dữ liệu của các bạn thuận tiện hơn, ít nhất là các bạn có được dữ liệu để thực hành, từ những thao tác trên các trang web này hy vọng sẽ tạo được sự thích thú đối với việc học môn Phân tích dữ liệu.

Luận Văn

  1. DART-Europe E-thesis Portal, Truy cập tới 1,3 triệu luận văn, luận án truy cập mở từ 580 trường Đại học ở 29 quốc gia châu Âu. Website: https://www.dart-europe.org

  2. Global ETD, CSDL có hơn 6 triệu luận văn, luận án điện tử có trong kho lưu trữ. Website: http://search.ndltd.org

  3. ProQuest Thesis and Dissertations Global, PQDT Open có hơn 60 ngàn nhan đề luận văn, luận án truy cập mở. Website: https://www.proquest.com/?defaultdiss=true

  4. Open Access Theses and Dissertations, OATD hiện có hơn 6 triệu luận văn, luận án từ hơn 1.100 trường cao đẳng, đại học và viện nghiên cứu. Website: https://oatd.org/

  5. EBSCO Open Dissertations, EBSCO Open Dissertations hiện có hơn 1,5 triệu luận văn, luận án từ 320 trường. Website: https://biblioboard.com/opendissertations/

Sách

  1. https://libvui.com

Một số trang web cung cấp dữ liệu miễn phí

  1. Dữ liệu của Tổ chức Hợp tác và Phát triển Kinh tế (Organization for Economic Cooperation and Development - OECD).

  2. Dữ liệu của Tổ chức y tế thế giới (World Health Organization - WHO).

  3. Dữ liệu của Ngân hàng thế giới (World Bank - WB).

  4. Dữ liệu của Quỹ tiền tệ quốc tế (International Monetary Fund - IMF).

  5. Dữ liệu của Ngân hàng phát triển Châu Á (The Asian Development Bank - ADB).

  6. Dữ liệu của Tổ chức Lương thực và Nông nghiệp Liên Hiệp Quốc (Food and Agriculture Organization of the United Nations)

  7. Our World in Data.

  8. National Centers for Environmental Information: Dig into the world’s largest provider of weather and climate data.

  9. https://download.bls.gov/pub/time.series/ Dữ liệu về time series

  10. http://data.un.org/Default.aspx

  11. https://unctadstat.unctad.org

  12. https://www.bis.org/statistics/index.htm?m=6%7C37

  13. https://ec.europa.eu/eurostat/data/database

  14. https://sdw.ecb.europa.eu/

  15. https://data.iadb.org/DataCatalog/Dataset

  16. https://www.federalreserve.gov/data.htm

  17. https://home.treasury.gov/

  18. https://www.bea.gov/data/economic-accounts/international

  19. https://fred.stlouisfed.org/

  20. https://data.gov/

  21. https://www.nationmaster.com/

  22. https://www.indexmundi.com/

  23. https://tradingeconomics.com/commodities

  24. Federal Reserve balance sheets: https://www.federalreserve.gov

  25. United Nations Human Development Reports: http://hdr.undp.org/en

  26. World Debt Clocks: https://worlddebtclocks.com/US

  27. World Government Bonds -CD Swaps: http://www.worldgovernmentbonds.com/sovereign-cds/

  28. UK House price indices: https://landregistry.data.gov.uk/app/ukhpiUS

  29. Treasury data sets https://fiscaldata.treasury.gov/datasets/

  30. Silver Institute supply and demand https://www.silverinstitute.org/silver-supply-demand/

  31. Measuring worth data sets on everything: https://www.measuringworth.com/index.php

  32. Federal Reserve Data sets on everything: https://www.newyorkfed.org/research/data_indicators

  33. Federal Reserve weekly balance sheet: https://www.federalreserve.gov/releases/h41/current/h41.htm

  34. Penn World Table https://www.rug.nl/ggdc/productivity/pwt

  35. Global Financial Data: https://www.globalfinancialdata.com

  36. The World Factbook: https://www.cia.gov/the-world-factbook

  37. Gapminder: https://www.gapminder.org

  38. World Income Inequality Database (WIID): https://www.wider.unu.edu/data

  39. Commodity Futures Trading Commission: https://www.cftc.gov/Marke…/CommitmentsofTraders/index.htm

  40. U.S. Bureau of Labor Statistics: https://www.bls.gov/bls/api_features.htm

  41. Migration Data Portal: https://www.migrationdataportal.org

  42. Missing Migrants Project by International Organization for Migration (IOM): https://missingmigrants.iom.int/data

  43. Our World In Data by Global Change Data Lab: https://ourworldindata.org/

  44. QoG Data: https://www.gu.se/…/qog…/data-downloads/standard-dataset

  45. UK Bank Database https://www.bankofengland.co.uk/boeapps/databas

  46. Bank of Japan: https://www.boj.or.jp/en/statistics/index.htm

Một số công cụ (tools) để lấy dữ liệu

Một số tổ chức có khối lượng dữ liệu rất khổng lồ, để việc cung cấp dữ liệu trở nên bài bản hơn, khoa học hơn thì các tổ chức này sẽ cung cấp công cụ phục vụ cho việc này.

Download dữ liệu từ World Bank

Để lấy được và lấy đúng dữ liệu chúng ta cần từ Worldbank chúng ta phải cài Package WDI và hiểu được tên các biến thống kê (indecator) do WB đặt. Tên và ý nghĩa của các indicator có thể tìm hiểu ở đường link: https://datahelpdesk.worldbank.org/knowledgebase/articles/201175-how-does-the-world-bank-code-its-indicators.

Sau khi đã hoàn thành bước cài đặt và tìm hiểu chúng ta sẽ thực hiện một số thao tác sau để tìm dữ liệu chúng ta cần và download về. Trong package WDI chúng ta thường xuyên sử dụng 2 hàm sau:

  • WDIsearh(): Được dùng để tìm những indicator liên quan đến dữ liệu mà chúng ta cần, do có rất nhiều indicator. Ví dụ chúng ta cần tìm những indicator liên quan đến GDP hoặc Dự trữ ngoại hối chúng ta thực hiện như sau:
Code
library(WDI)
library(DT)
library(tidyverse)
library(scales)
Code
ind <- WDIsearch('gdp')
datatable(ind)
ind <- WDIsearch('Total reserves')
datatable(ind)

Chúng ta thấy kết quả của câu lệnh này sẽ trả về tên của các indicator và chú thích của chúng.

  • WDI(): Sau khi đã tìm được indicator cần thiết, chúng ta sẽ tiến hành việc download dữ liệu. Ví dụ nếu chúng ta cần dữ liệu về tăng trưởng GDP bình quân đầu người của Việt Nam thì chúng ta sẽ thực hiện như sau:
Code
d <- WDI(indicator = 'NY.GDP.PCAP.KD.ZG', country = 'VN', extra = T, start = 1960, end = 2022)
tmp <- d %>% select(year, NY.GDP.PCAP.KD.ZG)
tmp <- na.omit(tmp)
names(tmp) <- c('year','GDP')

#tmp$GDP <- percent(tmp$GDP, accuracy = .01)
datatable(tmp)

Tương tự chúng có thể download dữ liệu về Dự trữ ngoại hối của Việt Nam theo tháng nhập khẩu và xử lý thì được kết quả như sau:

Code
d <- WDI(indicator = 'FI.RES.TOTL.MO', country = c('VN'), extra = T)
tmp <- d %>% select(year,FI.RES.TOTL.MO)
tmp <- na.omit(tmp)
names(tmp) <- c('year','DuTru')
datatable(tmp)