Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: re: speed of R graphics vs Stata graphics


From   "Airey, David C" <david.airey@Vanderbilt.Edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: re: speed of R graphics vs Stata graphics
Date   Wed, 1 Sep 2010 18:53:32 -0500

.

> I was cutting my teeth on some graphics related analysis of gene microarrays using R Bioconductor packages. In some of the plots there may be 10K to 40K data points. I noticed a significant speed advantage to the R graphics in such plots with many symbols, and with trellis (panel) graphics. To confirm my impression I plotted 100K points generated using corr2data with a correlation of 0.5 in Stata and R using scatter y x and with(mydata(plot(x,y)). Stata draws each symbol as you watch and took 9 seconds. R draws the plot off screen and then it appears after less than 3 seconds. I'm using StataMP 11.1 and R 2.11.1.
> 
> (1) Anybody notice this speed advantage to R with graphics?
> 
> (2) Anybody notice Stata and R about both have 11.1 in their version numbers?
> 
> 

Now this is fascinating:

. scatter y x, ms(oh) aspect(1)
r; t=8.57 18:45:15

. scatter y x, ms(oh) aspect(1) mlw(vthin)
r; t=8.45 18:46:14

. scatter y x, ms(oh) aspect(1) mlw(vvthin)
r; t=7.73 18:48:59

. scatter y x, ms(point) aspect(1) 
r; t=6.21 18:49:44

It takes less time in Stata to graph smaller symbols or symbols with less paint!
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index