2738 search results for "gis"

Log odds ratios and an indicator matrix from categorical data

October 4, 2012
By
Log odds ratios and an indicator matrix from categorical data

A long title, but there are a couple of handy things in this Gist. The first, and more obscure, is the conversion of a data.frame of categorical variables into a matrix of dummy/binary/indicator variables, one for each category of each original variab...

Read more »

Transforming a color scale

October 3, 2012
By
Transforming a color scale

In developing plots, I often use color (or “colour” in ggplot2 parlance) to reflect values of a third, non-X/Y, variable. Depending on the distribution of this Z variable, however, the effective color range can be narrow, making it difficul...

Read more »

Emerging as Low Vol

October 2, 2012
By
Emerging as Low Vol

Extending the series begun with When Russell 2000 is Low Vol, I thought I should take a look at Emerging Market stocks during periods of low relative volatility to the S&P 500.  So you can replicate even without access to expensive data, let

Read more »

A replacement for theme_blank()

October 2, 2012
By
A replacement for theme_blank()

ggplot2 has just hit 0.9.2, and with the change comes a new theme system. Previous versions of ggplot2 offered a theme_blank(), which was a stripped-down, essentially blank plotting canvas, but it is now deprecated. github user jrnold has produced a s...

Read more »

Connecting the real world to R with an Arduino

October 2, 2012
By
Connecting the real world to R with an Arduino

If connecting data to the real world is the next sexy job, then how do I do this? And how do I connect the real world to R? It can be done as Matt Shottwell showed with his home made ECG and a patched version of R at useR! 2011. However, there are ot...

Read more »

Example 10.4: Multiple comparisons and confidence limits

October 1, 2012
By
Example 10.4: Multiple comparisons and confidence limits

A colleague is a devotee of confidence intervals. To him, the CI have the magical property that they are immune to the multiple comparison problem-- in other words, he feels its OK to look at a bunch of 95% CI and focus on the ones that appear to exclude the null. This though...

Read more »

When Russell 2000 is Low Vol

October 1, 2012
By
When Russell 2000 is Low Vol

Continuing in my exploration of the Russell 2000 (Russell 2000 Softail Fat Boy), I thought I would try to approach the topic with a low volatility paradox mindset.  Since 2005, beta of the Russell 2000 compared to the S&P 500 has exceeded 1.2 ...

Read more »

Level fit summaries can be tricky in R

October 1, 2012
By
Level fit summaries can be tricky in R

Model level fit summaries can be tricky in R. A quick read of model fit summary data for factor levels can be misleading. We describe the issue and demonstrate techniques for dealing with them.When modeling you often encounter what are commonly called categorical variables, which are called factors in R. Possible values of categorical variables Related posts:

Read more »

Making random, equally-sized partitions

October 1, 2012
By
Making random, equally-sized partitions

Sometimes, as with cross-validation, one needs to generate k partitions, each with an equal number of observations. There are probably an infinite number of ways this could be done in R, but the Gist below illustrates one way to do it in four lines, w...

Read more »

Quantifying student feedback using Org mode and R

September 30, 2012
By
Quantifying student feedback using Org mode and R

As the term has progressed, my LSM2241 lectures are getting more consistent. I’m aiming to use 45 slides for what is officially a two hour lecture, although in reality it lasts about 90 minutes. We take a break at about 50 … Continue reading →

Read more »