# Monthly Archives: June 2009

## 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...

## Reading data, and a graph

June 25, 2009
By

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...

## 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

## 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...

## 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....

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

June 24, 2009
By

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...

## Book now discounted 33% at Amazon!

June 24, 2009
By

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.

## 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...

## 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 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 the...

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

June 22, 2009
By

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