R for the Super Bowl



This page relates to the working paper entitled "Permuting Super Bowl Theory". The paper discusses the evidence for the Super Bowl indicator of the stock market.

Introduction to R

R is free, open-source software that provides an environment for data analysis, graphics and statistics. You can download the software, documentation and so on from the R Project website.

A brief (8 pages) introduction to using R is "A Guide for the Unwilling S User".

An exposition of some of the merits of R is "An Introduction to the S Language".


Using R for the Super Bowl Data

Though these instructions are written for R, the functions and data are suitable for S-PLUS as well.

1) Download ("save frame as" or "save page as" or "save as") the permutation test functions permtest.R and have this file on your computer (with the same filename).

You can view the help files for these functions in html: permutation.test.discrete.html     plot.permtstBurSt.html
(The Rd form of the help files is available on the public domain code page.)

2) Download the Super Bowl data: superbowl_data.R

3) Start R:
If you are on Windows, then use the "change dir" item in the file menu in R to change the working directory to wherever the downloaded R files are.

If you are on Linux or Unix, start R in the directory where the R files are.

If you are on a Macintosh, you'll have to figure out what to do yourself (but it is likely to be reasonably simple).

4) Type the following to R:

source("permtest.R")

(followed by hitting the "enter" key). This will put the permutation test functions into R. To give the data to R, do:

source("superbowl_data.R")

You can see the objects that have been created by typing:

ls()

5) You can also download R_super_session.txt

This is an R session that manipulates the data and uses the permutation test functions. You can use the R "source" function on this file to perform the actions in it, but you are likely to learn more by doing the commands yourself.

6) Use R until you enjoy it (everything new has its frustrations).


R Mailing Lists

The R-help mailing list provides a place where questions can be asked (and usually expeditiously answered) about using R. There is also a mailing list specifically for those who are interested both in R and finance.

You can join the R-help mailing list via the R Project website.
Sign up to the R-finance list via:
https://www.stat.math.ethz.ch/mailman/listinfo/r-sig-finance


Go to Burns Statistics Home.

Direct access to this page is http://www.burns-stat.com/pages/Flotsam/r_for_superbowl.html

Last Modified: 2004 November 01