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

465

Version

1.3.0

License

GPL-2

Maintainer

Steve Miller

Last Published

May 16th, 2024

Functions in stevedata (1.3.0)

ESSBE5

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

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

"Let Them Watch TV"
LTPT

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

British Attitudes Toward Immigration (2018-19)
ESS10NO

Norwegian Attitudes toward European Integration (2021-2022)
LOTI

Land-Ocean Temperature Index, 1880-2022
GHR04

Comparative Public Health: The Political Economy of Human Misery and Well-Being
Lipset59

Democracy and Economic Development (Around) 1949-50
USFAHR

U.S. Foreign Aid and Human Rights in Assorted Years
PPGE

Partisan Politics in the Global Economy
PRDEG

Property Rights, Democracy, and Economic Growth
SBCD

Systemic Banking Crises Database II
Newhouse77

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

South Carolina County GOP/Democratic Primary Data, 2016
Presidents

U.S. Presidents and Their Terms in Office
af_crime93

Statewide Crime Data (1993)
OODTPT

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

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

Ozone Depleting Gas Index Data, 1992-2022
clemson_temps

Daily Clemson Temperature Data
election_turnout

State-Level Education and Voter Turnout in 2016
TV16

The Individual Correlates of the Trump Vote in 2016
asn_stats

Aviation Safety Network Statistics, 1942-2019
eq_passengercars

Export Quality Data for Passenger Cars, 1963-2014
co2emissions

Carbon Dioxide Emissions Data
arg_tariff

Simple Mean Tariff Rate for Argentina
eurostat_codes

Eurostat Country Codes
arcticseaice

Arctic Sea Ice Extent Data, 1901-2015
fakeAPI

Hypothetical (Fake) Data on Academic Performance
fakeHappiness

Fake Data on Happiness
eustates

EU Member States (Current as of 2019)
african_coups

Modeling Coups in Africa, 1960 to 1975 (1982)
gss_wages

The Gender Pay Gap in the General Social Survey
coffee_imports

Coffee Imports for Select Importing Countries
aluminum_premiums

LME Aluminum Premiums Data
illiteracy30

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

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

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

Minimum Legal Drinking Age Fatalities Data
mm_nhis

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

Data from the RAND Health Insurance Experiment (HIE)
mvprod

Motor Vehicle Production by Country, 1950-2019
min_wage

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

Global Average Absolute Sea Level Change, 1880–2015
scb_regions

Region Codes in the Central Bureau of Statistics ("Statistiska centralbyrån") in Sweden
ghp100k

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

Fake Data for a Time-Series
thatcher_approval

Margaret Thatcher Satisfaction Ratings, 1980-1990
sweden_counties

The Counties of Sweden
sugar_price

IMF Primary Commodity Price Data for Sugar
steves_clothes

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

Attitudes about Immigration in the World Values Survey
wvs_justifbribe

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

Cross-National Rates of Trade Union Density
ukg_eeri

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

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

Turnip prices in Animal Crossing (New Horizons)
therms

Thermometer Ratings for Donald Trump and Barack Obama
voteincome

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

Select World Bank Commodity Price Data (Monthly)
nesarc_drinkspd

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

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

Abortion Attitudes (ANES, 2012)
anes_partytherms

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

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

Abortion Opinions in the General Social Survey
usa_chn_gdp_forecasts

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

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

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

A Simple Panel drawn from World Bank Open Data
wvs_usa_abortion

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

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

Syncing Word Values Survey Country Codes with CoW Codes
fakeLogit

Fake Data for a Logistic Regression
quartets

Anscombe's (1973) Quartets
states_war

State Performance in Inter-State Wars
fakeTSCS

Fake Data for a Time-Series Cross-Section
recessions

United States Recessions, 1855-present
yugo_sales

Yugo Sales in the United States, 1985-1992
wvs_usa_regions

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

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

State Abbreviations, Names, and Regions/Divisions
so2concentrations

Sulfur Dioxide Emissions, 1980-2020
Arca

NYSE Arca Steel Index data, 2017–present
DCE12

Domestic Conflict Events, 2012
Dee04

Are There Civics Returns to Education?
CP77

Education Expenditure Data (Chatterjee and Price, 1977)
DJIA

Dow Jones Industrial Average, 1885-Present
EBJ

The Economic Benefits of Justice
DAPO

Determinants of Arab Public Opinion
Datasaurus

The Datasaurus Dozen
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