August Guerrilla Class: Using R for Performance Analysis

June 29, 2009
By
August Guerrilla Class: Using R for Performance Analysis

Registrations are still open for the Guerrilla Data Analysis Techniques (GDAT) class being held August 10-14, 2009. The focus will be on using R and the new release of PDQ-R for performance analysis and capacity planning.All Guerrilla classes are hel...

Read more »

Time series data

June 28, 2009
By
Time series data

gdp attach(gdp)as.Date(date)plot(gdp~date, data=gdp,pch=16,xlab="",ylab="GDP (2000 dollars)")

Read more »

Time series data

June 28, 2009
By
Time series data

gdp attach(gdp)as.Date(date)plot(gdp~date, data=gdp,pch=16,xlab="",ylab="GDP (2000 dollars)")

Read more »

RSI(2) Evaluation

June 28, 2009
By
RSI(2) Evaluation

Despite my best efforts, it's been a month since the last post of this series. The first post replicated this simple RSI(2) strategy from the MarketSci Blog using R. The second post showed how to replicate the strategy that scales in/out of RSI(2). ...

Read more »

Conservatism of Congressional delegation and %Bush vote

June 27, 2009
By
Conservatism of Congressional delegation and %Bush vote

Busy day today, so I'll just post this:plot(bush04 ~ cons_hr, type = "n",xlab="Mean ACU rating",ylab="2004 Bush vote",xlim=c(0,100),ylim=c(0,100),cex.lab=1.25,cex.axis=0.75,col.axis = "#777777",col.lab = "#777777")text(y=bush04,x=cons_hr, labels=statei...

Read more »

Conservatism of Congressional delegation and %Bush vote

June 27, 2009
By
Conservatism of Congressional delegation and %Bush vote

Busy day today, so I'll just post this:plot(bush04 ~ cons_hr, type = "n",xlab="Mean ACU rating",ylab="2004 Bush vote",xlim=c(0,100),ylim=c(0,100),cex.lab=1.25,cex.axis=0.75,col.axis = "#777777",col.lab = "#777777")text(y=bush04,x=cons_hr, labels=statei...

Read more »

R 2.9.1, CRANberries outage, and missing Java support

June 27, 2009
By

Just a short note that version 2.9.1 of R was released yesterday. And a corresponding Debian release went out as usual on the same day. One sour note: as the Java toolchain is currently broken, I had to disable compile-time support for Java. Just run R...

Read more »

R 2.9.1, CRANberries outage, and missing Java support

June 27, 2009
By

Just a short note that version 2.9.1 of R was released yesterday. And a corresponding Debian release went out as usual on the same day. One sour note: as the Java toolchain is currently broken, I had to disable compile-time support for Java. Just run R CMD javareconf once installed if you need it. Speaking of broken, I had...

Read more »

Multiple Imputation with Diagnostics (mi) in R: Opening Windows into the Black Box

June 26, 2009
By

Our article (by Yu-Sung, Jennifer, Masanao, and myself, and based also on work with Kobi, Grazia, and Peter Messeri) will be appearing in the Journal of Statistical Software, in a special issue on missing-data imputation. Here's the abstract: ...

Read more »

Filtering cases

June 26, 2009
By
Filtering cases

Something that's very important to be able to do in data analysis and visualization is to filter out cases. Let's say you want to do identical analyses of two different groups, or of one group and then a subset of it. R can do this a little differently; instead of merely filtering out cases you can create an object...

Read more »

Filtering cases

June 26, 2009
By
Filtering cases

Something that's very important to be able to do in data analysis and visualization is to filter out cases. Let's say you want to do identical analyses of two different groups, or of one group and then a subset of it. R can do this a little differently; instead of merely filtering out cases you can create an object...

Read more »

Development of tikzDevice is underway

June 26, 2009
By

Development of the R package tikzDevice has been underway for about a month now. This package allows for the output of R graphics as TikZ commands. Charlie Sharpsteen and I have gotten it into an alpha stage. There is no real documentation but there is plenty of comments in the code. We have a R-forge

Read more »

Set the significant digits for each column in a xtable for fancy Sweave output

June 26, 2009
By
Set the significant digits for each column in a xtable for fancy Sweave output

This tip may be useful in the situations when you need to set the number of digits to print for the different columns in a matrix/data.frame to be outputted as a LaTeX table.  For example: #install.packages("xtable") #library(xtable) tmp <- m...

Read more »

A bit about linear models

June 26, 2009
By

Before we delve into slightly more advanced plotting commands I want to talk a little about linear models, specifically, linear regression. In R this is very, very simple. For instance, in our 'states' data frame, we might want to look at median household income as a predictor of state education expenditures. The command lm calculates this for us. We'll...

Read more »

A bit about linear models

June 26, 2009
By

Before we delve into slightly more advanced plotting commands I want to talk a little about linear models, specifically, linear regression. In R this is very, very simple. For instance, in our 'states' data frame, we might want to look at median household income as a predictor of state education expenditures. The command lm calculates this for us. We'll...

Read more »

Reading data, and a graph

June 25, 2009
By
Reading data, and a graph

Using Microsoft Excel I'm collecting aggregate data, by state, of various social, political, and economic indicators. I export them into a tab-delimited file called 'states.txt' (pretty clever, I know.) I've got data on education expenditures, firearm deaths per capita, median household income, etc. I'd like to do some analysis and graphing of these data to see if there are...

Read more »

Reading data, and a graph

June 25, 2009
By
Reading data, and a graph

Using Microsoft Excel I'm collecting aggregate data, by state, of various social, political, and economic indicators. I export them into a tab-delimited file called 'states.txt' (pretty clever, I know.) I've got data on education expenditures, firearm deaths per capita, median household income, etc. I'd like to do some analysis and graphing of these data to see if there are...

Read more »

Delete a List Component in R

June 24, 2009
By

In R, the way to delete a component in a list object is different from matrix and vector objects. For a vector, to delete an element:vec <- c(1, 2, 3)vec <- vecFor a matrix, to delete a row or a column:mat <- matrix(c(1,2,3,4), 2, 2)mat2 <- mat # delete a rowmat3 <- mat # delete a columnFor a list,...

Read more »

Delete a List Component in R

June 24, 2009
By

In R, the way to delete a component in a list object is different from matrix and vector objects. For a vector, to delete an element:vec <- c(1, 2, 3)vec <- vecFor a matrix, to delete a row or a column:mat <- matrix(c(1,2,3,4), 2, 2)mat2 <- mat # delete a rowmat3 <- mat # delete a columnFor a list,...

Read more »

A start

June 24, 2009
By

I've decided that this summer I will finally break down and force myself to learn a little bit about using R. I currently use Stata, a very good program, but the idea of R is appealing since it's free under the GNU license. It has a large and active us...

Read more »

A start

June 24, 2009
By

I've decided that this summer I will finally break down and force myself to learn a little bit about using R. I currently use Stata, a very good program, but the idea of R is appealing since it's free under the GNU license. It has a large and active us...

Read more »

Weekly R Clinic

June 24, 2009
By

For readers at Vanderbilt: At yesterday's R course I found out that Theresa Scott in the Biostatistics department holds a weekly R clinic and encourages new R users who want to learn more to bring any questions about R, or even your own code and data. The R clinic is held weekly on Thursday from 2:00-3:00 in MCN....

Read more »

Example 7.3: Simple jittered scatterplot with smoother for dichotomous outcomes with continuous predictors

June 24, 2009
By
Example 7.3: Simple jittered scatterplot with smoother for dichotomous outcomes with continuous predictors

It's useful to look at scatterplots even when the "y" variable is dichotomous. For example, this can help determine whether categorization or linear assumptions would be more plausible. However, an unmodified scatterplot is less than helpful, since all of the "y" values are either 0 or 1, and are hard to separate visually. Some jittering...

Read more »

Book now discounted 33% at Amazon!

June 24, 2009
By
Book now discounted 33% at Amazon!

Our book, SAS and R: Data Management, Statistical Analysis, and Graphics, is discounted by a full third at Amazon. With free shipping! Also, they claim if it is further discounted before it ships, they'll give you the reduced price.

Read more »

PDF tutorial from R course (Introduction to R)

June 23, 2009
By

Writing from the previously mentioned intro to R course at the Kennedy Center. If you couldn't make it you can download all the course materials from Theresa Scott's website, under the "Current Teaching Material" heading. Here is a direct link to the PDF for the overview materials that we're going over today, along with the R code...

Read more »

I had been wondering what impact my friending 200 people from my…

June 22, 2009
By
I had been wondering what impact my friending 200 people from my…

I had been wondering what impact my friending 200 people from my Gmail address book had, so I scraped the dates from the notification emails. The plot shows notifications of friend requests from other people to me in black and confirmations of my requests to other people in red. That sudden and sharp increase at...

Read more »

Who’s Tweets Do I Read… Magic R Code Says…

June 22, 2009
By
Who’s Tweets Do I Read… Magic R Code Says…

So one glace at my user logs shows the truth: no one gives a rat’s rump that I just quit my job; you just love you some Twitter R code. And I’m nothing but an attention whore, so come get some! So in my last ‘Twitter with R’ post I gave you some code I’d written

Read more »

Parallel computing in R: snowfall/snow

June 20, 2009
By

I finally have time to try parallel computing in R using snowfall/snow thanks to this article in the 1st issue of R journal, which replaces R news. I didn’t try it before because i didn’t have a good toy example, and it seemed like a steep learning curve (i only guessed what parallel computing was).

Read more »

Network Analysis Software: focus on F/OSS

June 20, 2009
By
Network Analysis Software: focus on F/OSS

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

Read more »