# Basics

### Compactly display the structure of an arbitrary R object

September 21, 2012 |

As you advance in your R use past “canned” functions and packages made by others, you may want to take information from one R object for use in another. For example, you may want to estimate a linear model, then use the results of that esti... [Read more...]

### How did I make this plot?

April 9, 2011 |

To make this plot, I used R's plot(), points() and lines() commands. If you have been wanting to learn how to plot in R, watch it unfold in this video tutorial:Also, here's the code I used:

### How to Bootstrap in R: The Case of R-squared

March 29, 2011 |

I recorded a new video tutorial whose original intent was to demonstrate how to write a for loop. As I wanted to make the for loop count for something, I decided that my application would be to write some code that computes the bootstrap approximation ...

### Basic Plots in R

March 7, 2011 |

Here's a tutorial I recorded on producing basic plots in R.I lost the script file I used to create the video to a horrifying black screen of death, but I used the data from the previous post (available here). Hopefully, the video is clear enough that ...

### Testing Multiple Linear Restrictions in R

March 3, 2011 |

This video shows a couple of things:1. How to test (multiple) linear restrictions in R.2. How to install a package in R. Here is the code I use in the video (with some extra comments).Here is the data set that I use in the video.

### How Does R Deal with Categorical Explanatory Variables?

March 1, 2011 |

Here's a video tutorial where I demonstrate an answer to this question.This video is designed to instill a baseline level of practical knowledge. There is more to how R treats factors in regression models. An interested reader should Google "R contra...

### Running a Regression in R

February 28, 2011 |

I created another video tutorial on R. This time, I discuss R's lm() command and how to use it for a variety of standard applications.Here is the code that goes with the video:Enjoy!

### Tutorial on Distributions in R

February 25, 2011 |

Here's a video tutorial I put together to go over how to generate a random sample from one of the commonly known parametric distributions in R.Along the way, I also discuss how some of the properties of estimators are reflected in the computations I pe...

### How to read and write Stata data (.dta) files into R

February 24, 2011 |

Here's an R tutorial where I explain how to read Stata data files into R (even if you don't own the program Stata). I also offer some other basic tips.Of note, you can also write Stata .dta files from R (if your coauthors or journals insist on having ...

### Delete rows from R data frame

October 8, 2009 |

Deleting rows from a data frame in R is easy by combining simple operations. Let’s say you are working with the built-in data set airquality and need to remove rows where the ozona is NA (also called null, blank or missing). The method is a conce... [Read more...]

### SAS: “The query requires remerging summary statistics back with the original data”

September 22, 2009 |

Coming from a background writing SQL code directly for “real” RDBMS (Microsoft SQL Server, MySQL, and SQLite), I was initially confused when SAS would give me the following ‘note’ for a simple summary PROC SQL query: 429 proc sql; 430 create table undel_monthly as 431 select 432 year(date) as year, 433 month(date) ... [Read more...]