Solving Big Problems with Oracle R Enterprise, Part II

June 27, 2012
By
Solving Big Problems with Oracle R Enterprise, Part II

Part II – Solving Big Problems with Oracle R Enterprise In the first post in this series (see https://blogs.oracle.com/R/entry/solving_big_problems_with_oracle), we showed how you can use R to perform historical rate of return calculations against investment data sourced from a spreadsheet.  We demonstrated the calculations against sample data for a small set of accounts.  While this worked...

Read more »

Factor Attribution 2

June 26, 2012
By
Factor Attribution 2

I want to continue with Factor Attribution theme that I presented in the Factor Attribution post. I have re-organized the code logic into the following 4 functions: factor.rolling.regression – Factor Attribution over given rolling window factor.rolling.regression.detail.plot – detail time-series plot and histogram for each factor factor.rolling.regression.style.plot – historical style plot for selected 2 factors factor.rolling.regression.bt.plot

Read more »

Figuring an exchange rate for sports scores

June 26, 2012
By

While the US's Major League Soccer is using advanced analytics to analyze ball movement and improve team composition, they might want to think about a smaller, but possibly more impactful, goal for analytics. Like, how to explain to an American audience what a 1-2 game means to a basketball or baseball fan not familiar with scoring in the beautiful...

Read more »

Blog with R Markdown and tumblr: Part II

June 26, 2012
By
Blog with R Markdown and tumblr: Part II

In Part I of this series I described how to set up your tumblr blog so that you can create posts like those on the example site R Markdown Blog. Now I’ll describe how you can actually create such posts. I’ll be using the RStudio IDE for the desktop in all the steps below,...

Read more »

Crazy RUT in Academic Context Why Trend is Not Your Friend

June 26, 2012
By
Crazy RUT in Academic Context Why Trend is Not Your Friend

In response to Where are the Fat Tails?, reader vonjd very helpfully referred me to this paper The Trend is Not Your Friend! Why Empirical Timing Success is Determined by the Underlying’s Price Characteristics and Market Efficiency is Irrelevant by P...

Read more »

reproducible documents/analytics in R: the knitr package

June 26, 2012
By
reproducible documents/analytics in R: the knitr package

When I am working in new institutions and I am asking: “Do you have a document management system?” I often get the answer:”Yap, we are using folders” … OKAY. Making analysis, developing applications and keeping an eye on code, data and applications make this even harder as it has to be. Of course not many

Read more »

Workshop on Structural Equation Models

June 26, 2012
By
Workshop on Structural Equation Models

The Ted Rogers School of Management at Ryerson University is offering a one-day, hands–on workshop on Structural Equation Modelling. The workshop focuses on SEM theory and applications using R and Amos. Instructors: Professor Richard Michon and Christine Buske When: July 11, 2012 (8:30 to 3:30 pm) Where: TRS...

Read more »

Grouped means (again)

June 26, 2012
By
Grouped means (again)

So, the post I did yesterday on aggregate seemed to go down well. One of the comments suggested I add an example. Other comments had other useful hints which I thought I’d pass on more formally. So here goes… The mtcars dataset in base has data on various aspects of cars – miles per gallon,

Read more »

How to Convert Rugby into Football/Soccer Scores

June 26, 2012
By
How to Convert Rugby into Football/Soccer Scores

Following the Irish rugby team’s humiliating 60-0 defeat to New Zealand, an interesting question was posed on Twitter: what does a 60-0 result convert to in football/soccer? Intrigued, I decided to gather some data from both the English premier league (this season, more data collected and future blog posts to come!) and the equivalent English

Read more »

Shading regions of the normal: The Stanine scale

June 26, 2012
By
Shading regions of the normal: The Stanine scale

For the presentation of norm values, often stanines are used (standard nine). These values mark a person’s relativ position in comparison to the sample or to norm values. According to Wikipedia: The underlying basis for obtaining stanines is that a normal distribution is divided into nine intervals, each of which has a width of 0.5

Read more »

Bayesian Nonparametrics in R

June 25, 2012
By
Bayesian Nonparametrics in R

On July 25th, I’ll be presenting at the Seattle R Meetup about implementing Bayesian nonparametrics in R. If you’re not sure what Bayesian nonparametric methods are, they’re a family of methods that allow you to fit traditional statistical models, such as mixture models or latent factor models, without having to fully specify the number of

Read more »

Strategy Diversification in R – follow up

June 25, 2012
By
Strategy Diversification in R – follow up

The strategies used in Strategy Diversification in R were labeled as Strategy1 and Strategy2. Strategy1 Indicator: 52 week Simple Moving Average Entry Rule: Buy 1000 shares when price crosses and closes above 52 week Simple Moving Average Exit Rule: Exit all positions when prices crosses and closes below 52 week Simple Moving Average Classification: Long … Continue reading...

Read more »

Rcpp 0.9.12

June 25, 2012
By

A bug-fix release 0.9.12 of Rcpp arrived earlier today on CRAN and is now in Debian too. This fixes a minor snafu with the Rcpp::Enviroment constructor following a minor change made for 0.9.11. It also reduces the number of unit tests running by de...

Read more »

Wordcloud of the Arizona et al. v. United States opinion

June 25, 2012
By
Wordcloud of the Arizona et al. v. United States opinion

Here’s one purely for fun – a wordcloud built from the Supreme Court’s opinion on Arizona et al. v United States.  Word clouds, though certainly not the most scientific of visualization techniques, are often engaging and “fun” ways to lead…Read more ›

Read more »

New R User Groups in Ankara, Toronto

June 25, 2012
By

Two new local R user groups to report this week. In Turkey, the Ankara R Users Group has just started up. No meetings are scheduled yet, so be sure to suggest a meeting time/location when you sign up. The Toronto-based R Matlab Users group focuses on financial services applications. Created by Bryan Downing (who also produces the QuantLabs blog),...

Read more »

Olive Oil NIR/VIS Spectra – 001 (ChemSpec)

June 25, 2012
By
Olive Oil NIR/VIS Spectra – 001 (ChemSpec)

I continue with the practicing with ChemSpec, and this time I import seven spectra of olive oil. This time I have been more careful and I have the frequency column as numeric form the CSV file. Once I have the spectra (with and offset):Take in account ...

Read more »

Avoid Overplotting of Text in Ordination Diagram

June 25, 2012
By
Avoid Overplotting of Text in Ordination Diagram

Referring to a recent posting on r-sig-eco mailing list I'll add this example to theBioBucket:library(vegan)library(vegan)data(dune)sol <- metaMDS(dune) # use ordipointlabel -# here is an example where I added cex according to species frequencies:pl...

Read more »

Grouped means (or anything else…)

June 25, 2012
By
Grouped means (or anything else…)

An easy one today, but something that stumped me for a while* the first time I tried it out. How do you get a group mean (or other summary statistic) from R? Lets say you have a Y variable that represents repetitions for each of however many factors. You could subset the data by each

Read more »

Example 9.36: Levene’s test for equal variances

June 25, 2012
By
Example 9.36: Levene’s test for equal variances

The assumption of equal variances among the groups in analysis of variance is an expression of the assumption of homoscedasticity for linear models more generally. For ANOVA, this assumption can be tested via Levene's test. The test is a function of the residuals and means within each group, though various modifications are used, including the Brown-Forsythe...

Read more »

Euro 2012: Day 18

June 25, 2012
By
Euro 2012: Day 18

As promised. Looks like a Spain Germany final.

Read more »

How many ecologists were on ECOLOG in 1992?

June 25, 2012
By
How many ecologists were on ECOLOG in 1992?

Remember 1992? I had just turned 13 and was still a year away from highschool when my true descent into nerdom and the internet would begin. Back then it was with a local BBS (Bulletin Board System) run by a guy in a trailer park named Charlie and a 1200 baud modem on...

Read more »

Making Reproducible Research Enjoyable

June 25, 2012
By
Making Reproducible Research Enjoyable

Note: this is a contributed article for the ICSA Bulletin and the basic idea can be summarized in this picture. It is hard to convince people to think about reproducible research (RR). There are two parts of difficulties: (1) tools used to be for ex...

Read more »

Grid2Polygons

June 25, 2012
By
Grid2Polygons

I’d like to introduce you to the Grid2Polygons function; an R function for converting sp spatial objects from class SpatialGridDataFrame to SpatialPolygonsDataFrame. The significance of this conversion is that spatial polygons can be transformed to a different projection or datum with the spTransform function in package rgdal. Postscript files created with spatial polygons are reduced in size and...

Read more »

Hodgkin-Huxley model in R

June 24, 2012
By
Hodgkin-Huxley model in R

One of the great research papers of the 20th century celebrates its 60th anniversary in a few weeks time: A quantitative description of membrane current and its application to conduction and excitation in nerve by Alan Hodgkin and Andrew Huxley. Only a...

Read more »

Split-plot 1: How does a linear mixed model look like?

June 24, 2012
By
Split-plot 1: How does a linear mixed model look like?

I like statistics and I struggle with statistics. Often times I get frustrated when I don’t understand and I really struggled to make sense of Krushke’s Bayesian analysis of a split-plot, particularly because ‘it didn’t look like’ a split-plot to … Continue reading →

Read more »

useR 2012: main conference braindump

June 24, 2012
By
useR 2012: main conference braindump

I knew R was versatile, but DANG, people do a lot with it: > > … I don’t think anyone actually believes that R is designed to make *everyone* happy. For me, R does about 99% of the things I … Continue reading →

Read more »

reading shape files in R

June 24, 2012
By
reading shape files in R

If I would like to adjust a shape file I normally used the way over an excel file or a text file to get a table and to join this with an existing shape file. Due to the sp and rgdal packages in R you can manipulate shapefiles directly in R: now lets map the

Read more »

Optimal sorting using rpart

June 24, 2012
By
Optimal sorting using rpart

Some time ago I read a nice post Solving easy problems the hard way where linear regression is used to solve an interesting puzzle. Following the idea I used rpart to find optimal decision tree sorting five elements.It is well known that...

Read more »

Querying DBpedia from R

June 24, 2012
By

DBpedia is an extract of structured information from wikipedia. The structured data can be retrieved using an SQL-like query language for RDF called SPARQL. There is already an R package for this kind of queries named SPARQL.There is an S4 class Dbpedia part of my datamart package that aims to support the creation of predefined parameterized queries. Here is...

Read more »