February 2013

A handy concatenation operator

February 12, 2013 | TszKin Julian

It may be useful for you to define a concatenation operator for characters. Sometimes, I find this is more intuitive and handy than using paste0 or paste. Also, it makes your code look better when you have nested paste, e.g.paste0("Y~",paste0("z",1:3, "*x",1:3,collapse="+"). The drawback is ... [Read more...]

More visualisation of 2012 NFL Quarterback performance with R

February 12, 2013 | Raymond Tse

In last week’s post I used R heatmaps to visualise the performance of NFL Quarterbacks in 2012. This was done in a 2 step process, Clustering QB performance based on the 12 performance metrics using hierarchical clustering Plotting the performance clusters using R’s pheatmap library An output from the step 1 is ... [Read more...]

How to do egen (stata cmd) in R

February 12, 2013 | TszKin Julian

egen(stata cmd) compute a summary statistics by groups and store it in to a new variable. For example, the data has three variables, id, time and y, we want to compute the mean of y by for each id and then store it as a new variable mean_y. ... [Read more...]

Cluster Portfolio Allocation

February 11, 2013 | systematicinvestor

Today, I want to continue with clustering theme and show how the portfolio weights are determined in the Cluster Portfolio Allocation method. One example of the Cluster Portfolio Allocation method is Cluster Risk Parity (Varadi, Kapler, 2012). The Cluster Portfolio Allocation method has 3 steps: Create Clusters Allocate funds within each Cluster ... [Read more...]

A Review of the R Graphics Cookbook

February 11, 2013 | Joseph Rickert

A common criticism of R, especially from data scientists who are new to R but proficient in multiple programming languages, is that R is “quirky” and annoying because there is almost always more than one way to do simple things. I usually counter that they are trying to say that ... [Read more...]

Did an Excel error bring down the London Whale?

February 11, 2013 | David Smith

When JP Morgan Chase announced it had lost more than 2 billion dollars on the capital markets back in May 2012, many pointed to the actions of rogue trader Bruno Iksil as the cause. But was the "London Whale" — the nickname he was given by other traders for his outsized positions — the ... [Read more...]

US unemployment rates by State 1981-2011

February 11, 2013 | leisuretronic

File under: getting data.Oh the irony. Exactly one day after I start to read the great book on Open Government by O'Reilly media (which they released in tribute to Aaron Schwartz), I come in need of time series data on unemployment rates in the United ... [Read more...]

R package building automation

February 11, 2013 | Michael kao

Title: R package building automationInspired by the post at http://giventhedata.blogspot.tw/2013/02/my-r-package-development-cheat-sheet.html. I have decided to publish my cheat script for package development as well. Building package used to be a nightmare, filling in all those Rdfiles manually can cause some serious brain damage. Thanks to the ... [Read more...]

Unknown Variance Two-Tailed Test of Population Mean

February 11, 2013 | skycondition

Question The mean safety audit score of ACME Co. stores in New York (n=200) was 74.3pts February last year.  Suppose we decided to sample 22 out of the 200 stores one year later. We find that the sample mean is 78.6pts and the sample standard deviation is 3.2pts.  Can we reject the ... [Read more...]

One R Function A Day.

February 11, 2013 | Huidong Tian

As a R user with 5 years experience, I still have some basic functions that never used or never thought they could exist. Many times I was suprised with some elegant R functions, such like strwidth, parent.frame, etc. No one can know all R functions (... [Read more...]

Variability of predicted portfolio volatility

February 11, 2013 | Pat

A prediction of a portfolio’s volatility is an estimate — how variable is that estimate? Data The universe is 453 large cap US stocks. The variance matrices are estimated with the daily returns in 2012. Variance estimation was done with Ledoit-Wolf shrinkage (shrinking towards equal correlation). Two sets of random portfolios were ... [Read more...]

Using R: accessing PANTHER classifications

February 10, 2013 | mrtnj

Importing, subsetting, merging and exporting various text files with annotation (in the wide sense, i.e. anything that might help when interpreting your experiment) is not computation and it’s not biology either, but it’s housekeeping that needs to be done. Everyone has a weapon of choice for general-purpose ... [Read more...]

Publishing from R+knitr to WordPress

February 10, 2013 | Yihui Xie

Tal Galili asked a question on StackOverflow on publishing blog posts to WordPress from R + knitr. William K. Morris has written a solution long time ago, and I tweaked it a little bit and created a function knit2wp() in the development version of knit... [Read more...]

Using deSolve package

February 9, 2013 | Phil

[This article was first published on Just Another R Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your [Read more...]

Exposure with binomial responses

February 9, 2013 | arthur charpentier

Last week, we’ve seen how to take into account the exposure to compute nonparametric estimators of several quantities (empirical means, and empirical variances) incorporating exposure. Let us see what can be done if we want to model a binomial response. The model here is the following: , the number of ... [Read more...]
1 8 9 10 11 12 15

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)