Student-Teacher Ratios

WDI package (World Development Indicators)

Published

May 9, 2019

Notable topics: WDI package (World Development Indicators)

Recorded on: 2019-05-09

Timestamps by: Alex Cookson

View code

Screencast

Timestamps

slice

Using slice function to select 10 highest and 10 lowest student-teacher ratios (like a filter using row numbers)

WDI

Adding GDP per capita to a dataset using WDI package

geom_text

Using geom_text to add labels to points on a scatterplot

WDIsearch
WDI

Using WDIsearch function from WDI package to search for country population data

Explanation of trick with geom_text function's check_overlap argument to get label for US to appear by rearranging row order

comma_format
scales

Using comma_format function from scales format to get more readable numeric legend (e.g., "500,000,000" instead of "5e+08")

WDI

Exploring different education-related indicators in the WDI package

spreadpivot_wider

Using spread function (now pivot_wider) to turn data from tidy to wide format

to_snake_case
snakecase

Using to_snake_case function from snakecase package to conver field names to snake_case

Exploring female/male school secondary school enrollment

Note of caution on keeping confounders in mind when interpreting scatterplots

lm

Creating a linear regression of secondary school enrollment to explore confounders

Discussing the actual confounder (GDP per capita) in the linear regression above

Adding world region as another potential confounder

aov

Using aov function (ANOVA) to explore confounders further

Reviewing and interpreting the final linear regression model

cor

Using cor function (correlation) to get correlation matrix for three variables (and brief explanation of multi-collinearity)

Summary of screencast