2157 search results for "twitter"

Aggregate Function in R: Making your life easier, one mean at a time

April 20, 2011
By
Aggregate Function in R: Making your life easier, one mean at a time

I previously posted about calculating medians using R. I used tapply to do it, but I’ve since found something that feels easier to use (at least to me). ?Download download.txt1 2 3 aggregated_output = aggregate(DV ~ IV1 * IV2, data=data_to_aggregate, FUN=median) aggregated_output The above code saves an aggregated dataset to aggregated_output and gives you the

Read more »

Export a Table Created by R to a TeX File

April 17, 2011
By
Export a Table Created by R to a TeX File

Producing tables in LaTeX might be a difficult task as we can not just copy and paste a table in the editor; we have to write all the numbers and other codes. But with the help of xtable package of R it is possible to produce all the necessary codes for producing table in LaTeX and also possible to...

Read more »

Introduction to Cointegration and Pairs Trading

April 15, 2011
By
Introduction to Cointegration and Pairs Trading

Introduction Suppose you see two drunks (i.e., two random walks) wandering around. The drunks don’t know each other (they’re independent), so there’s no meaningful relationship between their paths. But suppose instead you have a drunk walking with her dog. This … Continue reading →

Read more »

Friday Function: setInternet2

April 15, 2011
By
Friday Function: setInternet2

Corporate IT networks are a pain for programmers. Ideally, when programming, you want the freedom to download, install and run any software that you want. Unfortunately, in the interests of security, many programmers find themselves a little restricted at the office. (I’m sure that many network admins will protest that the situation works both ways

Read more »

R 2.12 to 2.13 package upgrade

April 14, 2011
By
R 2.12 to 2.13 package upgrade

If you: use Linux have just upgraded your R installation from 2.12 to 2.13 installed some/all of your packages in your home area (e.g. ~/R/i486-pc-linux-gnu-library/2.12) and… …are wondering why R can’t see them any more just do this: # at a shell prompt cp ~/R/i486-pc-linux-gnu-library/2.12 ~/R/i486-pc-linux-gnu-library/2.13 # in R console update.packages(checkBuilt=TRUE, ask=FALSE) # back to

Read more »

Problems with ggplot2 0.8.9 and R 2.13.0 on Mac OS X via plyr 1.5

April 14, 2011
By

This morning I tried to completely update my R installation. I first dumped a list of all the packages I have on my system using the installed.packages() function. Then I installed R 2.13.0 using the OS X disk image. And finally I reinstalled all of my packages from scratch. Unfortunately, I ran into some serious

Read more »

In case you missed it: March Roundup

April 14, 2011
By

In case you missed them, here are some articles from February of particular interest to R users. The doSMP package, which enables parallel processing for R on multiprocessor machines, is now available on CRAN. The Offensive Politics blog provided R code used to make a map of precinct returns in the Chicago mayoral election. A connector to integrate R...

Read more »

ARMA Models for Trading, Part I

April 14, 2011
By
ARMA Models for Trading, Part I

Lately I have been testing trading models based on methods from various fields: statistics, machine learning, wavelet analysis and others. And I have been doing all that in R! In this series, I will try to share some of these efforts starting with the well-known from statistics Autoregressive Moving Average Model (ARMA). There is a

Read more »

Mixtures in Madrid (3)

April 14, 2011
By
Mixtures in Madrid (3)

For my second lecture today, I need to plot a likelihood surface for a basic two-component mixture with only the means unknown: here is the R code to speed up things llsurf=function(trumyn=2.,wayt=.3,var2=1.,ssiz=500){ # draws the log-likelihood surface and a random sample sd2=sqrt(var2) parti=(runif(ssiz)>wayt) sampl=(1-parti)*rnorm(ssiz)+parti*(trumyn+sd2*rnorm(ssiz)) mu2=mu1=seq(min(sampl),max(sampl),.1) mo1=mu1%*%t(rep(1,length(mu2))) mo2=(rep(1,length(mu2)))%*%t(mu2) ca1=-0.5*mo1*mo1 ca2=-0.5*mo2*mo2 like=.1*(ca1+ca2) # log prior N(0,10) for

Read more »

Le Monde puzzle #13

April 13, 2011
By
Le Monde puzzle #13

This week, Le Monde offers not one but three related puzzles: Is it possible to label the twelve edges of a cube by consecutive numbers such that the sum of the edge numbers at any of the eight nodes is constant? Is it possible to label the eight nodes of a cube by consecutive numbers

Read more »