Blog Archives

Legends in ggplot2

May 22, 2011
By
Legends in ggplot2

A simple plot takes a few lines of coding:g1 <- ggplot(d, aes(birth.year))g2 <- g1 + geom_line(aes(y=alive0, linetype="Famale")) +  geom_line(aes(y=alive1, linetype="Male")) + scale_linetype_discrete(name = "")g3 <- g2 + geom_point(aes(y=...

Read more »

Extension to mtable function

May 4, 2011
By

Here are some useful extension to the "mtable" function in the memisc package.

Read more »

Extension to mtable function

May 4, 2011
By

Here are some useful extension to the "mtable" function in the memisc package.

Read more »

Ask R not to create a local directory tree

March 12, 2011
By

I don't like R to create a local directory tree in my home directory because new packages will automatically be installed into that directory. The way to do this is to modify the "/usr/local/lib64/R/etc/Renviron" and mark the line "R_LIBS_USER=${R_LIBS...

Read more »

Ask R not to create a local directory tree

March 12, 2011
By

I don't like R to create a local directory tree in my home directory because new packages will automatically be installed into that directory. The way to do this is to modify the "/usr/local/lib64/R/etc/Renviron" and mark the line "R_LIBS_USER=${R_LIBS...

Read more »

Rstudio

February 28, 2011
By

Rstudio, an open source cross-platform IDE for R, seems to be really attractive. It probably will not drag me away from Emacs, but having more options is always a good thing.The only downside of it is that it automatically installs R from the...

Read more »

Rstudio

February 28, 2011
By

Rstudio, an open source cross-platform IDE for R, seems to be really attractive. It probably will not drag me away from Emacs, but having more options is always a good thing.The only downside of it is that it automatically installs R from the...

Read more »

Simulating second difference using Zelig

February 11, 2011
By

I am trying to simulate second difference using Zelig, here is my code:--------------------------------------------------------data(turnout)# estimationz.out <- zelig(vote ~ race*age + educate + income,            ...

Read more »

Simulating second difference using Zelig

February 11, 2011
By

I am trying to simulate second difference using Zelig, here is my code:--------------------------------------------------------data(turnout)# estimationz.out <- zelig(vote ~ race*age + educate + income,            ...

Read more »

Post-estimation results manipulation: Stata vs. R

January 26, 2011
By

Stata's new "margins" command is as powerful as "Zelig" package for R for the purpose of conducting post-estimation manipulation of the results (e.g. producing predicted probabilities, confidence intervals, etc.). While "margins" uses delta method, "Ze...

Read more »