Ben Mazzotta's Weblog

Ben Mazzotta is a postdoc at the Center for Emerging Market Enterprises (CEME).

Posts Tagged ‘R

R starter resources

with 3 comments

I’m hardly the first person you would want to talk to about learning statistics in R. But if you’re bent on teaching yourself R, and you’ve ended up at my blog, here are some resources I found useful. (No opinions here about whether R is good/bad better/worse than Excel, Minitab, Matlab, Octave, SPSS, Stata, SAS, or others.)

R Rroject is the mothership.

Rstudio is an IDE for R, which provides a better GUI for some basic tasks. Most of what you’d expect from a modern IDE: syntax highlighting, GUI commands for loading and saving data, setting the working directory, separate panes for help files.

UCLA tutorials are a well written introduction to basic data entry, functions, and graphics in R. There are similar tutorials for Stata and other languages here as well.

Quick-R is a blog and a book written by a statistician for people switching from SPSS and Stata to R. Excellent and concise website detailing all of the basics: data entry, functions, plots, and how to think about all of the above.

R help list and archives are a way to ask questions of experienced users. You’ll get excellent help here, but it’s important to respect the etiquette. Basically, (1) read the package manual, (2) work up a minimal example with your question, and (3) be extremely precise about the data you have and the data you want, as opposed to the way you’re trying to solve that problem. This will become clearer if you read a few discussions in the archives.

StackExchange is a glorified bulletin board for programmers exchanging help and (frequently great) advice. Search the archives before posting new questions–the guys that hang out here hate duplicate postings. But it’s easier to navigate than the R help archives.

Read the rest of this entry »

Written by Ben Mazzotta

June 8, 2012 at 1:29 pm

Posted in statistics, technology

Tagged with , ,

Demonstration of {estout}

leave a comment »

I wrote a short talk demonstrating the use the R package {estout} for tonight’s New England R Users Group meeting.  NB this is not a discussion of the econometric model, but rather a demonstration of how to get publication-quality results out of R efficiently.

The basic functions of {estout} are modeled on the Stata package estout. Once the R user has a dataset and a regression format in memory, {estout} will

  1. Print tables of summary statistics in CSV or LaTeX format.
  2. Print regression results in CSV or LaTeX format.

All the normal bells and whistles for econometrics are in there: reporting both coefficient estimates and their standard errors, asterisks for alpha=0.10, 0.05, and 0.01 significance levels, R-squared and number of observations. Options to customize are clearly marked in the documentation.

Read the rest of this entry »

Written by Ben Mazzotta

August 24, 2010 at 12:57 pm

Posted in statistics, technology

Tagged with

R goes to StackExchange

leave a comment »

“What’s the big deal? We already have the r-help mailing list.”

No, it’s a big deal. Really.

Have you forgotten the joys of being a first-year R user, either begging advice off of friends or using Google to search archives of the R-help list? (Firefox has a dedicated search add-on for the R-help archives.) Yes, it gets the job done, but it’s kludge. If you’re a self-taught R programmer you know what I’m talking about.

StackExchange for Statistical Analysis will let experienced users answer statistics questions, presented in a legible format, and good answers are promoted to the top of the list. Questions can be tagged by subject matter and by package. Proper formatting for code swatches, and for discussion. It’s modeled on StackOverflow.

Read the rest of this entry »

Written by Ben Mazzotta

July 6, 2010 at 5:50 am

Posted in statistics, technology

Tagged with , ,

Export Trade Clusters

leave a comment »

This post, as with the prior ones on trade clusters, aims to help visualize patterns of trade in the OECD from 50 years of partner trade statistics. The data is rich, meaning we should be able to develop rich intuition by exploring it visually.

These slides follow the method laid out in Jong-Eun Lee, “Two Maps for the World’s Trade Integration,” Applied Economics Letters, 11:4 (2004). All computations were performed in R.

Written by Ben Mazzotta

November 24, 2009 at 10:18 pm

Network Analysis Software: focus on F/OSS

with 5 comments

What do you use for network analysis? I found the Wikipedia list of network software entirely overwhelming. I wanted to test out some of the introductory tools, but avoid the trap of sinking my time into a dead-end software project. (Remember learning Minitab in freshman statistics? How often do you use Minitab today for anything other than freshman statistics?)

UCINET came very well recommended by several friends who use social network analysis for business and politics. I wasn’t sure whether it would turn out to be a proprietary, one-way data sink like Blackboard or a useful, interoperable tool for analyzing and sharing data.

The Journal of Statistical Software published an issue about Statnet in 2008. Esteemed authors in the field wrote a number of great tutorials about Statnet, which is an umbrella package for most of R’s network analysis tools.

UC Irvine hosts a wiki on network analysis tools. That wiki describes a few of the F/OSS tools. All the links contain tutorials. You have your choice of tools that are freestanding, part of R, or part of Sage/Python. If you’ve got a good reason to go with one of the other F/OSS tools, such as Guess, Pajek or Networkx, please comment with your thoughts.

Read the rest of this entry »

Written by Ben Mazzotta

June 20, 2009 at 7:35 am

Resources for Learning R in Iraq?

leave a comment »

Please comment on this if you know of Arabic and Kurdish language resources for learning R.

I have been encouraging the economics faculty here to learn R for econometrics, both on grounds of quality and cost.

Here is a short list of resources that can help new users make the transition from SPSS if they choose.

  1. Home page and downloads http://cran.r-project.org/
  2. Instructions from UCLA http://www.ats.ucla.edu/stat/r/
  3. Instructions for SPSS Users http://statmethods.net/
  4. Graph examples http://addictedtor.free.fr/graphiques/
  5. Econometrics with R (pdf) http://cran.r-project.org/doc/contrib/Farnsworth-EconometricsInR.pdf

These resources are all in English. Does anyone know where to find R manuals or tutorials in Arabic?

Update: the R project posts foreign-language tutorials in Chinese, French, German, Italian, and several other languages but no Arabic.

Written by Ben Mazzotta

May 6, 2009 at 10:52 am

Posted in statistics

Tagged with , , , ,

Follow

Get every new post delivered to your Inbox.