Learn R Programming

collapse (version 1.1.0)

wlddev: World Bank Development Data

Description

This dataset contains 4 indicators from the World Bank's World Development Indicators (WDI) database: (1) GDP per capita, (2) Life expectancy at birth, (3) GINI index and (4) Net ODA received. The panel-data is balanced and covers 216 present and historic countries from 1960-2018 (World Bank aggregates and regional entities are excluded). Apart from the indicators the data contains a number of identifiers (character country name, factor ISO3 country code, World Bank region and income level, numeric year and decade) and 2 generated variables: A logical variable indicating whether the country is an OECD member, and a fictional variable stating the date the data was recorded. These variables were added so that all common data-types are represented in this dataset, making it an ideal test-dataset for certain collapse functions.

Usage

data("wlddev")

Arguments

Format

A data frame with 12744 observations on the following 12 variables. All variables are labelled e.g. have a 'label' attribute.

country

chr Country Name

iso3c

fct Country Code

date

date Date Recorded (fictional)

year

num Year

decade

num Decade

region

fct World Bank Region

income

fct World Bank Income Level

OECD

log Is OECD Member Country?

PCGDP

num GDP per capita (constant 2010 US$)

LIFEEX

num Life expectancy at birth, total (years)

GINI

num GINI index (World Bank estimate)

ODA

num Net ODA received (constant 2015 US$)

See Also

GGDC10S, Collapse Overview

Examples

Run this code
# NOT RUN {
data(wlddev)

# Panel-summarizing the 4 series
qsu(wlddev, pid = ~iso3c, cols = 9:12, vlabels = TRUE)

# By Region
qsu(wlddev, by = ~region, cols = 9:12, vlabels = TRUE)

# Panel-summary by region
qsu(wlddev, by = ~region, pid = ~iso3c, cols = 9:12, vlabels = TRUE)

# Pairwise correlations: Ovarall
print(pwcor(get_vars(wlddev, 9:12), N = TRUE, P = TRUE), show = "lower.tri")

# Pairwise correlations: Between Countries
print(pwcor(fmean(get_vars(wlddev, 9:12), wlddev$iso3c), N = TRUE, P = TRUE), show = "lower.tri")

# Pairwise correlations: Within Countries
print(pwcor(fwithin(get_vars(wlddev, 9:12), wlddev$iso3c), N = TRUE, P = TRUE), show = "lower.tri")

# }

Run the code above in your browser using DataLab