Blog Archives

Obama approval

July 12, 2009
By
Obama approval

Working some more with time series data. Here we have a graph of Obama job approval numbers, with two LOWESS-fit lines added for trending: Figure1. President Obama job approval, Jan 2009 - present.There's actually some pretty fancy stuff going on there, as the following code shows.polls lfit1 lfit2 plot (app~daten, ylim=c(40,80), xlim=c(-3,210),pch=16, col="gray",cex.lab=1.25,cex.axis=0.75,col.lab = "#777777", xlab="",ylab="Obama...

Read more »

Return

July 6, 2009
By

I'm back from vacation, so I'll post something substantive later today.

Read more »

Return

July 6, 2009
By

I'm back from vacation, so I'll post something substantive later today.

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 »

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 »

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 »

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 »