Educational Videos

I have four main video series, listed on this page: Principles of Microeconomics, Introduction to R for Economists, Introduction to Causality, and Advanced Stata Tips. I also have a few stray additional videos, which you can see here, in addition to a few more stragglers which you can see by going directly to my YouTube channel. Feel free to subscribe; who knows when I'll get the itch to make another series!

This series of videos is meant to accompany my Principles of Microeconomics (ECON 201) class. Or, if you're a non-CSUF visitor, you can use it as a free principles of micro course! You can see these videos on a YouTube playlist as well here.

This lecture is equivalent to the first day lecture in ECON 201. Here we cover the basics of incentives, and a bevy of important vocabulary terms.

This lecture is equivalent to the second day lecture in ECON 201. Here we cover comparative advantage, and the tricky problem of how to most efficiently use the resources at hand.

This lecture is equivalent to the first Supply and Demand lecture in ECON 201. Here we cover the basics of the supply and demand model - how it works, how it explains price and quantity, and how it describes markets as working.

This lecture is equivalent to the second Supply and Demand lecture in ECON 201. Here we cover how the supply and demand model MOVES AROUND! No point to the model if you don't move it around.

This lecture is equivalent to the first post-Midterm 1 lecture in ECON 201. Here we cover the ONE GOLDEN RULE to explain all of economics! Marginal thinking ahead...

This lecture is equivalent to the second post-Midterm 1 lecture in ECON 201. Here we cover the the cost structure for a firm, and see how firms in competitive markets choose quantities that maximize their profits.

This lecture is equivalent to the Elasticity lecture in ECON 201. Here we cover the the cost structure for a firm, and see how firms in competitive markets choose quantities that maximize their profits.

This lecture is equivalent to the Efficiency lecture in ECON 201. Here we cover the allocation of goods, and how different ways of allocating goods leads to resources being used more or less efficiently. We also talk a lot about competitive markets, and snow shovels.

This lecture is equivalent to the Market Failure lecture in ECON 201. Here we cover the times when competitive markets will NOT lead to efficient results. We cover externalities, as well as goods that may not be rival in consumption, or may not be excludable.

This lecture is equivalent to the first Pricing Power lecture in ECON 201. Here we cover what happens when competition is limited in some way - pricing power! We cover the causes of pricing power, how a monopoly maximizes profit, and what to do about monopolies.

This lecture is equivalent to the second Pricing Power lecture in ECON 201. Here we cover market structures aside from competitive and monopolistic markets - oligopolies and monopolistic competition. We also look at how firms with pricing power use price discrimination.

This lecture is equivalent to both game theory lectures in ECON 201. Here we cover the basics of game theory, including sequential and simultaneous games, and the problems with commitment that both of them lead us to!

This lecture is equivalent to the Partial Information lecture in ECON 201. Here we cover the times when we don't know the full consequences of our actions! We cover expected utility, risk, search, and information-providing firms.

This lecture is equivalent to the Asymmetric Information lecture in ECON 201. Here we cover the times when one person in a transaction knows more than someone else. Lemons ahoy!

This lecture is equivalent to the first Labor Economics lecture in ECON 201. Here we cover the basics of what is essentially the biggest market around! What goes into labor supply and labor demand? And why do different people earn different wages?

This lecture is equivalent to the second Labor Economics lecture (Wage Differentials) in ECON 201. Here we cover reasons why different people earn different wages, other than simply being differently productive! We cover compensating differentials, labor unions, and discrimination.

This series of videos is aimed at the undergraduate Econ crowd as well as any other economists getting started in R. It's aimed at explaining the R software package through the lens of the kinds of things that economists tend to do. The videos are divided into Basics, Moderate, and Advanced. You can see these videos on a YouTube playlist as well here. **Note that if you click through to the YouTube video, the code shown in each video is available through a link in the description.** Or, you can simply download a ZIP file with all the code here.

BASIC R VIDEOS

In this video, I cover how to install R and RStudio, and how to work your way around RStudio. Just settling in to the whole thing. Soon we'll be up and running! This video doesn't cover rstudio.cloud which can also be handy.

In this video, I cover how to use the documentation in R. I cover the help search bar, the help() function, ??, and searching for R help on the internet.

In this video I cover the basics of working with variables, creating new ones, using the is. and as. functions, and manipulating variables.

This video will cover the basics of using vectors and matrices in R, from creating them with c() and cbind() to exploring them with [] and proper indexing. Not to mention using vectors inside vectors!

This video offers an introduction to data frames, showing how to create them out of matrices using as.data.frame (although skipping over how to create them from scratch using data.frame() - check it out!), how to select variables using $, and how to look at the data using head().

This video expands on the introduction to data frames, showing how to manipulate variables using $, and how to choose a subset of the rows and columns of the data using the subset() command.

This video will cover how to install (with install.packages() or the Packages tab) and load (with library() or the Packages tab) packages in R. The particular package we'll be loading is "foreign", which contains the read.dta() function we'll need to load in data for the next few videos!

This video will cover how to calculate basic statistics, like mean and standard deviation, with a single variable, or how to look at all the levels of a categorical or discrete variable with table(). It will also show how to create summary statistics tables with summary() and stargazer().

This video will cover how to calculate summary statistics of two variables, including correlations with cor(), cross-tabulations with table(), comparing the means of two variables with t.test(), and calculating summary statistics by group with aggregate().

This video covers the basics of plotting in R, using the commands plot() for scatterplots, hist() for histograms, plot(density()) for kernel densities, barplot() for bar graphs, and plot(,type="l") with aggregate() for line graphs.

MODERATE R VIDEOS

This video will cover how to include something in your regression commands other than just a list of controls! These tips apply to all kinds of regression, too, not just OLS. These include square and threshold terms with I(), logs with log(), interaction terms with * or :, and sets of dummies with factor().

In this video we cover what to do once you've already run your regression! We pull out the predicted values and residuals with predict() and residuals(), we use Breusch-Pagan (bptest()) to check for heteroskedasticity, we calculate heteroskedasticity- or cluster-robust standard errors with coeftest() in the sandwich package, and we perform F-tests of regression coefficients with linearHypothesis() in the AER package. These commands and tests work with all kinds of regression commands, not just OLS (lm()).

In this video we cover how to make plots of your regression after you've performed it. We produce residual plots, plots of fitted values, and we overlay the regression line on top of a scatterplot.

In this video we cover how to perform an instrumental variables regression using ivreg() from the AER package. We also cover how to estimate the first stage separately, and run an F-test on the instruments using linearHypothesis().

In this video we cover the basics of time series analysis, from making time series objects with ts(), loading them in with data(), plotting them with plot(), plotting autocorrelation and partial autocorrelation functions with acf() and pacf(), performing Dickey-Fuller with adf.test(), and some seasonality with stl() and seasonplot(). Lots of stuff!

In this video we cover how to use R's ARIMA command arima(), which also covers ARMA models. I also show how to use these models to forecast the future using forecast() from the forecast package. That's about it!

In this video I cover some basic limited dependent variable models, in particular how to do probit and logit with glm() and then get their marginal effects with the mfx package. I even go over ordered logit and ordered probit with polr() and their marginal effects with ocME().

In this video I cover how to perform a Tobit regression with censReg() and get its marginal effects with margEff(). We also cover how to perform a sample selection regression, or Heckman model, with selection().

In this video, I cover the basics of panel data using library(plm), pdata.frame()s, and performing fixed effects, random effects, and first-difference regressions with plm(), as well as the Hausman test (phtest()).

ADVANCED R VIDEOS

In this video, I cover how to create your own random data (using rnorm() and similar commands) in order to perform a simulation that will allow you to test how much of a problem it is if your assumptions fail! The only other new command here is for loops, but I cover a few advanced ways of putting it all together.

In this video, I provide an introduction to the tidyverse library, which is a great way of handling data manipulation. I address the better-than-data-frames tibbles and as.tibble(), the better-than-head() glimpse(), and the better-than-read.dta read_dta in the haven package.

In this video I cover how to reshape your data from wide to long format using gather(), and then how to join/merge two data sets together using the various join commands in tidyverse. I also cover the concept of the observation level, very important when joining!

In this video I cover the basics of using dplyr, a package for manipulating data. In this video I cover how dplyr is structured, and how you can use mutate() to create variables, filter() and select() to subset rows and columns, arrange() to sort the data, and rename() to rename variables.

In this video I will cover how to use the pipe operator %>% in dplyr to chain together multiple operations at once. Highly useful!

In this video I will cover how to use group_by() in dplyr, which will prove highly useful in combination with mutate() and summarize().

In this video I go over a very basic introduction to the ggplot function from the ggplot2 package (from, of course, the tidyverse). I illustrate how to put together a ggplot command by combining a data set, an aes()thetic, and a geometry (geom_point()) in the example). Check out the ggplot2 reference manual here!

In this video we go further into ggplot, detailing some of the geometries you're most likely to use in your graphcs - geom_point() for scatterplots, geom_bar() for bar graphs, geom_histogram() for histograms, geom_density() and stat_density() for density plots, and geom_line() for line graphs.

In this video we go further into ggplot, detailing how to overlay graphs on top of each other, with examples on putting a regression line (geom_smooth) over a scatterplot (geom_point) or putting straight lines (geom_hline and geom_vline) over scatterplots and density (geom_density) plots. I also go over how to draw graphs separately by group by including a color, shape, or linetype aspect in the aes()thetic.

The final video! In this video I go over how to put labels and titles on your ggplot()s. I go over axis labels with xlab() and ylab() as well as whole-graph titles with ggtitle(). Finally, I cover how to label your legends as desired, either by carefully labeling your factor variables, or with scale_color_manual() and/or labs().

BONUS R VIDEOS

This video is a brief introduction to the vtable package, which I wrote. The function vtable() makes it quick and easy to look at information about your variables while you continue to work on your data, without repeatedly calling head(), glimpse(), etc., or to automatically create variable documentation files to share with others.

These videos offer an introduction to causality, using causal diagrams as a way into understanding the concept of identification, and how we can use modeling with data to make causal claims without having to run an experiment. The later videos also offer a basic overview of common causal inference methods. The videos can also be seen on a YouTube playlist here.

The first video in a series on causality, intended for my ECON 305 class Economics, Causality, and Analytics.

This video introduces the concept of writing our assumptions down in a causal diagram. These are going to come in very handy as we work with all sorts of real-world data generating processes and try to understand how we can get causal inferences out of them!

This video discusses how we can take our own ideas about how the world works and encode them in a causal diagram. You'll be able to take what you know and put it in a format that you can actually use to identify your questions of interest.

This video discusses how to use the causal diagram-drawing website Dagitty.net. Dagitty will come in handy for a number of homework assignments that require you to draw diagrams. It also comes in handy generally in that it can tell you how to identify your effect of interest!

This video discusses how you can list the paths from X to Y on a causal diagram, determine whether they are front or back door paths, and select control variables to close the back doors and identify your causal effect of interest.

This video discusses what it means to control/adjust for a variable in order to close a back door, and walks through the mechanics of how it can be done.

This video discusses those tricksy collider variables - variables that close back door paths all by themselves, and will bias your results if you control for them!

The eighth video in a series on causality introduces the first tool for our causal inference toolbox: fixed effects, which allows us to control for certain kinds of variables even if we can't measure them!

The ninth video in a series on causality introduces the concept of identifying a causal effect by comparing a treated group and a comparable untreated group. We then explore one way of doing this: constructing that comparable untreated group ourselves using coarsened exact matching!

This video covers one of the most widely-used causal inference methods: Difference-in-Differences (or Diff-in-Diff, or DID, or DD...).

This video covers what is considered to be one of the most trustworthy observational causal inference research designs: regression discontinuity, aka what happens when you are carried across a threshold.

This series of videos is somehow my most popular by far. It provides Stata tips for the advanced user, and assumes you already have a moderate knowledge of how to use Stata. You can see these videos on a YouTube playlist as well here.

The first video I made for YouTube and by far the worst video quality! This is a nice time-saving trick that I use with some regularity when I have to write some tedious code. Usually this approach is taking the place of a nicer-looking for loop of some kind directly in your stats package, but I find that using Excel like this can often save a lot of time over writing the for loop if the task isn't nice and clean. Also, in some cases it's easier to check that you've done it correctly, and make the process robust to strangely formatted data like what I have here.

This is a very useful trick that I use all the time whenever I am doing data editing in Stata. Stata-specific, too! Can't get this to work in most other statistics packages.

Two of the trickest Stata commands that you will almost certainly finding yourself having to use if you're manipulating panel data!

If there are missing observations in your data it can really get you into trouble if you're not careful. Some notes on how to handle it.

If you've ever tried to use old versions of Stata to open datasets made in newer versions, you know it doesn't quite work right! Let's figure out how to do it.

This video will explain how to use Stata's inline syntax for interaction and polynomial terms, as well as a quick refresher on interpreting interaction terms.

This will go over the basic syntax and information about foreach and forvalues loops in Stata, as well as how to use them with levelsof.

Just some nice quick shortcuts to save you some time in Stata! Nothing too major here, but these tips may save you a little bit of time.

Don't you dare spend hours copying over every cell of your table by hand! There are many easier ways to get your results out of Stata. Goes over outreg2, mkcorr, and copying tables.

Don't you dare spend hours copying over every cell of your table by hand! There are many easier ways to get your results out of Stata. Goes over outreg2, mkcorr, and copying tables.

This video will talk about some of the basics of bootstrapping, which is a handy statistical tool, and how to do it in Stata.

This describes the very simple steps for creating some very nice-looking tables for your research papers. It uses Stata to create the tables in the first place, but these steps could just as easily follow from a Stargazer output in R, or something else entirely. I won't claim this is the only way to do it, but this is quick, easy, and always looks good!

The birth of a thousand internet comments, the Monty Hall Problem does actually have a single correct solution (assuming it was described correctly - if they forgot to mention that Monty knows where the car is it is indeed 50:50!). This video has nine different explanations to provide an intuitive understanding of this strange result.