Learn R Programming

⚠️There's a newer version (1.5.0) of this package.Take me there.

stevedata: Steve’s Toy Data for Teaching About a Variety of Methodological, Social, and Political Topics

{stevedata} is an R package full of toy data sets that you may find useful for various purposes. Namely, I’ve created probably over a hundred toy data sets along the way, either to riff on some topic on my blog, show my students something in one of my many classes, or just to entertain myself. I had stuffed a lot of these into {stevemisc}, but I want to keep that package mostly about the functions (and whatever data are necessary for showing off the functions). {stevedata} will have all my toy data going forward.

I anticipate two sets of R users may find these data useful. First, instructors may find these data useful for classes on a variety of topics, but prominently quantitative methods and international relations. Many of the toy data sets included in this R package are data I’ve acquired or assembled to teach about topics in quantitative methods or international relations in a reproducible way. Users should see my Github repositories for my classes on introduction to international relations, quantitative methods in political science, and foundations of social science research for public policy to see how I’ve used these data (or development versions of them). Topics here are diverse, including (but not limited to) carbon dioxide emissions over 800,000 years (as an illustration of climate change), coffee prices (as an illustration of the worsening terms of trade, the justifiability of bribe-taking (as an illustration of information-poor and discrete variables that a researcher may be tempted to treat as drawn from a normal distribution), the canonical case of illiteracy rates in the 1930 U.S. Census (as an illustration of an ecological fallacy), and many, many more topics.

Second, my students in these classes (but especially my methods classes) should find this R package useful. I will also be having my methods students (undergraduate and graduate) download this package to work through problem sets in the R programming language. It’d be a benefit to them (and less hassle/headache for myself) to have my students download this package from CRAN rather than work through potential curl issues by installing through Github.

In almost all instances, each data set has an underlying code/script that generates them. These are in a data-raw directory that is (increasingly) included in the Github repository (but not the R package).

Installation

This package is now on CRAN. You can download it as you would any other R package.

install.packages("stevedata")

You can also install the development version of {stevedata} from Github via the {devtools} package. I suppose using the {remotes} package would work as well.

devtools::install_github("svmiller/stevedata")

Usage

The data set already has a lot to offer those who might be curious about its contents. You can do this to see what is in it.

data(package = "stevedata")

You can also check the website for more information. There is an informal vignette that describes these data in some detail.

Copy Link

Version

Install

install.packages('stevedata')

Monthly Downloads

498

Version

1.0.0

License

GPL-2

Maintainer

Steven Miller

Last Published

May 30th, 2023

Functions in stevedata (1.0.0)

Presidents

U.S. Presidents and Their Terms in Office
PRDEG

Property Rights, Democracy, and Economic Growth
LTPT

Long-Term Price Trends for Computers, TVs, and Related Items
OODTPT

Data for "Optimal Obfuscation: Democracy and Trade Policy Transparency"
PPGE

Partisan Politics in the Global Economy
LOTI

Land-Ocean Temperature Index, 1880-2022
Newhouse77

Medical-Care Expenditure: A Cross-National Survey (Newhouse, 1977)
ODGI

Ozone Depleting Gas Index Data, 1992-2022
LTWT

"Let Them Watch TV"
Guber99

School Expenditures and Test Scores for 50 States, 1994-95
TV16

The Individual Correlates of the Trump Vote in 2016
af_crime93

Statewide Crime Data (1993)
SCP16

South Carolina County GOP/Democratic Primary Data, 2016
anes_vote84

Simple Data for a Simple Model of Individual Voter Turnout (ANES, 1984)
anes_partytherms

Major Party (Democrat, Republican) Thermometer Index Data (1978-2012)
anes_prochoice

Abortion Attitudes (ANES, 2012)
arcticseaice

Arctic Sea Ice Extent Data, 1901-2015
aluminum_premiums

LME Aluminum Premiums Data
SBCD

Systemic Banking Crises Database II
arg_tariff

Simple Mean Tariff Rate for Argentina
clemson_temps

Daily Clemson Temperature Data
coffee_price

The Primary Commodity Price for Coffee (Arabica, Robustas)
asn_stats

Aviation Safety Network Statistics, 1942-2019
co2emissions

Carbon Dioxide Emissions Data
commodity_prices

Select World Bank Commodity Price Data (Monthly)
eq_passengercars

Export Quality Data for Passenger Cars, 1963-2014
eurostat_codes

Eurostat Country Codes
coffee_imports

Coffee Imports for Select Importing Countries
election_turnout

State-Level Education and Voter Turnout in 2016
eight_schools

The Effect of Special Preparation on SAT-V Scores in Eight Randomized Experiments
eustates

EU Member States (Current as of 2019)
fakeTSD

Fake Data for a Time-Series
gss_spending

Attitudes Toward National Spending in the General Social Survey (2018)
fakeLogit

Fake Data for a Logistic Regression
ghp100k

Gun Homicide Rate per 100,000 People, by Country
gss_abortion

Abortion Opinions in the General Social Survey
fakeAPI

Hypothetical (Fake) Data on Academic Performance
fakeHappiness

Fake Data on Happiness
gss_wages

The Gender Pay Gap in the General Social Survey
fakeTSCS

Fake Data for a Time-Series Cross-Section
mm_nhis

Data from the 2009 National Health Interview Survey (NHIS)
min_wage

History of Federal Minimum Wage Rates Under the Fair Labor Standards Act, 1938-2009
mm_mlda

Minimum Legal Drinking Age Fatalities Data
inglehart03

"How Solid is Mass Support for Democracy---And How Can We Measure It?"
nesarc_drinkspd

The Usual Daily Drinking Habits of Americans (NESARC, 2001-2)
mvprod

Motor Vehicle Production by Country, 1950-2019
pwt_sample

Penn World Table (10.0) Macroeconomic Data for Select Countries, 1950-2019
quartets

Anscombe's (1973) Quartets
thatcher_approval

Margaret Thatcher Satisfaction Ratings, 1980-1990
sweden_counties

The Counties of Sweden
ukg_eeri

United Kingdom Effective Exchange Rate Index Data, 1990-2022
sealevels

Global Average Absolute Sea Level Change, 1880–2015
mm_randhie

Data from the RAND Health Insurance Experiment (HIE)
turnips

Turnip prices in Animal Crossing (New Horizons)
recessions

United States Recessions, 1855-present
usa_chn_gdp_forecasts

United States-China GDP and GDP Forecasts, 1960-2050
usa_tradegdp

U.S. Trade and GDP, 1790-2018
voteincome

Sample Turnout and Demographic Data from the 2000 Current Population Survey
sugar_price

IMF Primary Commodity Price Data for Sugar
illiteracy30

Illiteracy in the Population 10 Years Old and Over, 1930
therms

Thermometer Ratings for Donald Trump and Barack Obama
uniondensity

Cross-National Rates of Trade Union Density
wvs_usa_educat

Education Categories for the United States in the World Values Survey
usa_migration

U.S. Inbound/Outbound Migration Data, 1990-2017
wvs_ccodes

Syncing Word Values Survey Country Codes with CoW Codes
usa_states

State Abbreviations, Names, and Regions/Divisions
usa_computers

Percentage of U.S. Households with Computer Access, by Year
so2concentrations

Sulfur Dioxide Emissions, 1980-2020
wvs_immig

Attitudes about Immigration in the World Values Survey
wvs_usa_abortion

Attitudes on the Justifiability of Abortion in the United States (World Values Survey, 1982-2011)
wbd_example

A Simple Panel drawn from World Bank Open Data
steves_clothes

Steve's (Professional) Clothes, as of March 20, 2022
yugo_sales

Yugo Sales in the United States, 1985-1992
wvs_justifbribe

Attitudes about the Justifiability of Bribe-Taking in the World Values Survey
wvs_usa_regions

Region Categories for the United States in the World Values Survey
CFT15

Randomization Inference in the Regression Discontinuity Design: An Application to Party Advantages in the U.S. Senate
DST

Casualties/Fatalities in the U.S. for Drunk-Driving, Suicide, and Terrorism
ESS10NO

Norwegian Attitudes toward European Integration (2021-2022)
DJIA

Dow Jones Industrial Average, 1885-Present
Dee04

Are There Civics Returns to Education?
CP77

Education Expenditure Data (Chatterjee and Price, 1977)
Arca

NYSE Arca Steel Index data, 2017–present
ESSBE5

Trust in the Police in Belgium (European Social Survey, Round 5)
Datasaurus

The Datasaurus Dozen
ESS9GB

British Attitudes Toward Immigration (2018-19)