Blog Archives

Quantile regression in R

January 5, 2008
By
Quantile regression in R

Roger Koenker, a quantile regression crusader, has an R package that implements the procedure. It is called quantreg, and it is documented here. This package has apparently been around for quite some time, but I was only recently turned on to quantile ...

Read more »

Rattle: an R GUI

December 16, 2007
By
Rattle: an R GUI

Rattle is a graphical interface to R. It supports basic data management tasks, as well as a number of different modeling functions. I haven’t had a chance to test it out yet since I don’t have my R installation  completely up to date, but it looks promising. For all of R’s strengths, one weakness is

Read more »

Linear panel data models in R: The PLM package

November 10, 2007
By
Linear panel data models in R: The PLM package

The plm package for R lets you run a number of common panel data models, including The fixed effects (or within) estimator The random effects GLS estimator It also allows for general GLS estimation, as well as GMM estimation, and includes a feature for heteroscedasticity consistent covariance estimation. It’s very easy to use, it simply

Read more »

Quick-R: a great R tutorial site

October 23, 2007
By
Quick-R: a great R tutorial site

Quick-R, by Robert Kabacoff, is a wonderful R introduction site. It covers data management, basic and advanced statistics, and graphing in R, and it is aimed at an audience that has previous experience using other packages (such as SAS or Stata) that w...

Read more »

Documentation and tutorial roundup

June 4, 2007
By
Documentation and tutorial roundup

I recently lost my documentation folder (oops), so I had to go online and retrieve the documentation files and tutorials that I find indispensible for working. I decided I’d save myself and everyone else the trouble by posting the list here. All of the files are available in PDF format. All R manuals Scilab documentation.

Read more »

R syntax highlighting for Smultron

June 14, 2006
By
R syntax highlighting for Smultron

Smultron is an open-source text-editor for OS X. It’s a very lean editor, but it’s fast and it was written in Cocoa. Out of the box it has syntax highlighting for Stata and LaTeX, but not R. Basic instructions for adding a rudimentary R syntax coloring file are available here. However, I have adapted the

Read more »

Merging data: A tutorial

May 7, 2006
By
Merging data: A tutorial

The situation: you have two datasets with a common variable, and you want to incorporate both into one large dataset containing all of the variables. This is called merging data, and it’s easy to do in any standard statistical package. In these examples, I assume that there is only one variable between any datasets to

Read more »

R Language Module for TextWrangler (and a lot of other editors)

February 27, 2006
By
R Language Module for TextWrangler (and a lot of other editors)

Via this page, I just learned that there is a TextWrangler Language Module for R. The file itself is available here. To install, copy the .plist file to the following directory Username/Library/Application Support/TextWrangler/Language Modules I also recommend going into TextWrangler’s preferences and changing the color for comments. The default is a gray color that doesn’t

Read more »

Basic factor analysis in R

February 17, 2006
By
Basic factor analysis in R

The call to perform factor analysis on a set of variables in R is: fact1<- factanal(x,factors,scores=c(“regression”),rotation=”varimax”) where “x” is a dataframe containing the appropriate variables, and “factors” is the number of factors to be extracted. socres=”…” and rotation=”…” are optional, and varimax is the default rotation. The factanal function doesn’t seem to handle missing observations

Read more »

Getting tables from R output

February 11, 2006
By
Getting tables from R output

Turning plain-text output into well-formatted tables can be a repetitive task, especially when many tests or models are being incorporated into a paper. For R users, there are several methods that can make this task easier (though not much less repetitive), regardless of what typesetting system you use. LaTeX tables The xtable package produces LaTeX-formatted

Read more »