Defaults, Lists and Classes: A Functional Post

May 20, 2011
By
Defaults, Lists and Classes: A Functional Post

In this post, I demonstrate a couple of useful tricks to writing functions in R. The context is a function I wrote called called samp() that allows for an easy demonstration of sampling distribution properties.DefaultsBy default, this function draws K...

Read more »

My programming journey

May 20, 2011
By
My programming journey

When clearing out some of my old programming books the other day I realised how far I’d come with programming over the years, and the number of different technologies that I have used over time. I thought I’d do a little summary post going from first programming experience to now – and it’s amazing what’s

Read more »

Long XLU Short SPY Part 2 (More History)

May 20, 2011
By
Long XLU Short SPY Part 2 (More History)

THIS IS NOT INVESTMENT ADVICE.  YOU ARE RESPONSIBLE FOR YOUR OWN GAINS AND LOSSES. The Fed is on a roll adding BAC ML Bond Indicies and now complete history for the four primary Dow Jones Indexes, so I wanted to extend my first post Long XLU Shor...

Read more »

Hacking the Kinect with R

May 20, 2011
By

I was browsing through the draft abstract booklet for this year's worldwide R user conference useR! 2011, and noticed this abstract: KinectR – Kinect interface to R Landon Jensen Microsoft launched the Kinect for Xbox 360 in late 2010 and it quickly broke records as the fastest selling consumer electronics device in history (8 million units sold in the...

Read more »

Long XLU Short SPY

May 20, 2011
By
Long XLU Short SPY

THIS IS NOT INVESTMENT ADVICE.  YOU ARE RESPONSIBLE FOR YOUR OWN GAINS AND LOSSES. I spend my days and nights wondering what a bond manager should do if he/she doesn’t like bonds, but also cannot sit in 0% cash.  I generally dislike spreads...

Read more »

Spreads and Stress

May 20, 2011
By
Spreads and Stress

Since we have the Gifts from BAC ML and the Federal Reserve, I thought I should look at another interesting element of bonds.  Bond spreads act as a very strong symbol of financial stability and confidence.  The St. Louis Fed Stress Index is ...

Read more »

Smaller or greater? – episode II

May 20, 2011
By
Smaller or greater? – episode II

In a previous post I introduced the following game: Suppose you play the following game: Someone holds a set of cards with the numbers {1,2,…,N} in random order, opens up the first card and asks if the next card is greater or smaller. Every time you predict correctly, you get one point, while every wrong

Read more »

Great circles, raster, sp and lattice

Great circles, raster, sp and lattice

Recently I found a post at FlowingData with a detailed tutorial to map connections with great circles with R. The tutorial of FlowingData is excellent, but I feel more comfortable with the sp classes and methods, and with the lattice and latticeExtra packages. Besides, I want to use the free spatial data available from the

Read more »

10 reasons why you should learn R

May 20, 2011
By

10. Can't crack that hard Sudoku problem?? Use R!9. Want to pick a skill that will give you an early adopter advantage?? Learn R! It is the leading open source statistical and data analysis programming language, and is heating up! 8. Need to ...

Read more »

10 reasons why you should learn R

May 20, 2011
By

10. Can't crack that hard Sudoku problem?? Use R!9. Want to pick a skill that will give you an early adopter advantage?? Learn R! It is the leading open source statistical and data analysis programming language, and is heating up! 8. Need to ...

Read more »

Syntax highlighting of R code at WordPress.com

May 20, 2011
By
Syntax highlighting of R code at WordPress.com

If your WordPress blog is hosted at WordPress.com (like this one), you may know that source code in posts is formatted and highlighted using a shortcode, as explained here. Until recently, R was not on the list of supported languages (neither was Perl), but I noticed today that both of them are now supported. This

Read more »

Porting Stata-like Marginal Effects to LaTeX

May 19, 2011
By
Porting Stata-like Marginal Effects to LaTeX

The TimeSeriesIreland Blog posted an excellent start on a function that automatically computes marginal effects for probit and logit models. As I have always wanted an easy-to-use function that computes and reports marginal effects in R, I was elated ...

Read more »

Porting Stata-like Marginal Effects to LaTeX

May 19, 2011
By
Porting Stata-like Marginal Effects to LaTeX

The TimeSeriesIreland Blog posted an excellent start on a function that automatically computes marginal effects for probit and logit models. As I have always wanted an easy-to-use function that computes and reports marginal effects in R, I was elated ...

Read more »

[Project Euler] – Problem 57

May 19, 2011
By

It is possible to show that the square root of two can be expressed as an infinite continued fraction.√ 2 = 1 + 1/(2 + 1/(2 + 1/(2 + … ))) = 1.414213…By expanding this for the first four iterations, we get:Read More: 547 Words Totally

Read more »

Friday fun with: Google Trends

May 19, 2011
By
Friday fun with: Google Trends

Some years ago, Google discovered that when people are concerned about influenza, they search for flu-related information and that to some extent, search traffic is an indicator of flu activity. Google Flu Trends was born. Illness is sweeping through our department this week and I have succumbed. It’s not flu but at one point, I

Read more »

More fun with boxplots

May 19, 2011
By

Here are a few more plotting options for boxplots: Let’s start plotting the full set plot(b$mod, b$x) Plot labels for a subset in full set plot (label all points x < -1) text(subset(b$mod, b$x < -1), subset(b$x, b$x < -1), … Continue reading →

Read more »

More Command-Line Text Munging Utilities

May 19, 2011
By
More Command-Line Text Munging Utilities

In a previous post I linked to gcol as a quick and intuitive alternative to awk. I just stumbled across yet another set of handy text file manipulation utilities from the creators of the BEAGLE software for GWAS data imputation and analysis. In additio...

Read more »

More Command-Line Text Munging Utilities

May 19, 2011
By
More Command-Line Text Munging Utilities

In a previous post I linked to gcol as a quick and intuitive alternative to awk. I just stumbled across yet another set of handy text file manipulation utilities from the creators of the BEAGLE software for GWAS data imputation and analysis. In additio...

Read more »

Hadley Wickham’s R Development Master Class coming to SF

May 19, 2011
By

Hadley Wickham, the Rice professor and prolific R hacker best known as the author of the ggplot2 graphics package, will be coming to San Francisco June 8-9 to deliver his new R Development Master Class (in conjunction with Revolution Analytics). This course will build on the skills of basic R programmers with instruction in advanced R programming techniques, development...

Read more »

Converting vectors to numeric in mixed-type dataframe

May 19, 2011
By

Coercing variables of character and numeric type into a single dataframe yields all vectors to be defined as factors all <- data.frame(cbind(site, year, model, x, y, z)) The following converts selected variables from “factor” back to “numeric” all$x <- as.numeric(x) … Continue reading →

Read more »

Bar Graphs in ggplot2

May 19, 2011
By
Bar Graphs in ggplot2

As part of my continuing fun and games getting to grips with ggplot2′s vast multitude of functions, here I give …Continue reading »

Read more »

Applying PDQ in R to Load Testing

May 19, 2011
By
Applying PDQ in R to Load Testing

PDQ is a library of functions that helps you to express and solve performance questions about computer systems using the abstraction of queues. The queueing paradigm is a natural choice because, whether big (a web site) or small (a laptop), all computer systems can be represented as a network or circuit of buffers and a buffer is a...

Read more »

Applying PDQ in R to Load Testing

May 19, 2011
By
Applying PDQ in R to Load Testing

PDQ is a library of functions that helps you to express and solve performance questions about computer systems using the abstraction of queues. The queueing paradigm is a natural choice because, whether big (a web site) or small (a laptop), all computer systems can be represented as a network or circuit of buffers and a buffer is a...

Read more »

R-bloggers

May 18, 2011
By
R-bloggers

As I decided to try and blog a little more often now, and touch on "R" every now and then, I decided to take R-bloggers up on their standing offer to include R-related feeds at their site. So, everything I tag with "rstats" (you can guess where that ca...

Read more »

R-bloggers

May 18, 2011
By
R-bloggers

As I decided to try and blog a little more often now, and touch on "R" every now and then, I decided to take R-bloggers up on their standing offer to include R-related feeds at their site. So, everything I tag with "rstats" (you can guess where that ca...

Read more »

Mapping locations in R with the Data Science Toolkit

May 18, 2011
By
Mapping locations in R with the Data Science Toolkit

Pete Warden's Data Science Toolkit (which we mentioned briefly last week) is an open-source information server that provides an API you can query for information useful for building data science applications, like identifying proper names in unstructured text, or converting IP addresses to lat/long coordinates. You can make queries via the Web interface or by direct interface to the...

Read more »

RStudio the missing link between your brain and statistics

May 18, 2011
By
RStudio the missing link between your brain and statistics

RStudio is a graphical user interface for R. Or as the developers put it. RStudio™ is a new integrated development environment (IDE) for R. RStudio combines an intuitive user interface with powerful coding tools to help you get the most out of R.   While there have been a few projects (e.g. RCommander, RkWard, JaguaR)

Read more »

Wonderful New Blog TimeSeriesIreland

May 18, 2011
By
Wonderful New Blog TimeSeriesIreland

I returned from Scotland to find a wonderful new blog from Ireland http://timeseriesireland.wordpress.com.  To highlight his work, I thought I would apply his most recent post AIB Stock Price, EGARCH-M, and rgarch to the S&P 500.  Clearly...

Read more »

Fractional Factorial Designs using FrF2

May 18, 2011
By

The FrF2 package for R can be used to create regular and non-regular Fractional Factorial 2-level designs. It is reasonably straightforward to use. First step is to install the package then make it available for use in the current session: require(FrF2) A basic call to the main functino FrF2 specifies the number of runs in

Read more »