Monthly Archives: February 2012

Cochran Q Test for k related samples in R

February 1, 2012
By
Cochran Q Test for k related samples in R

To run the Cochran Q Test in R, we need to download the package of it first, since it is not built-in in R. The name of the package is RVAideMemoire authored by Maxime Hervé. Here's how to do it.Codes:Here we are installing the package named RVAideMem...

Read more »

Transformation of Several Variables in a Dataframe

February 1, 2012
By
Transformation of Several Variables in a Dataframe

This is how I transform several columns of a dataframe, i.e., with count-data into binary coded data (this would apply also for any other conversion..).count1

Read more »

Vectorized R vs Rcpp

February 1, 2012
By
Vectorized R vs Rcpp

In my previous post, I tried to show, that Rcpp is 1000 faster than pure R and that generated the fuss in the comments. Being lazy, I didn’t vectorize R code and at the end I was comparing apples vs oranges. To fix that problem, I built a new script, where I’m trying to compare

Read more »

Are Recessions Environmentally Beneficial?

February 1, 2012
By
Are Recessions Environmentally Beneficial?

Description:Total energy consumption in the United States by sector.  Vertical gray lines represent periodsof recession.Data:http://www.eia.gov/totalenergy/data/annual/index.cfm#consumptionhttp://en.wikipedia.org/wiki/List_of_recessions_in_the_Uni...

Read more »

MAT886 mean excess function (and reinsurance)

February 1, 2012
By
MAT886 mean excess function (and reinsurance)

Tomorrow, in the course on extreme value, we will focus on applications. We will discuss reinsurance pricing. Consider a random variable , a threshold and define the mean excess function. This function is known in life insurance as the average ...

Read more »

"R": Looking at the Data (Gasoline) – 001

February 1, 2012
By
"R": Looking at the Data (Gasoline) – 001

As other softwares "R" has nice tools to look to the data before to develop the calibration.Statistics for the "Y" variable (in this case octane number) like Maximun, Minimun,..,standard deviation,...are important:> library(ChemometricsWithR)> data(gasoline)> summary(gasoline$octane)   Min.  1st Qu.  Median    Mean   3rd Qu.    Max.   83.40   85.88    87.75    87.18   88.45    89.60> sd(gasoline$octane) 1.530078And of course the Histogram:> hist(gasoline$octane)

Read more »

Confirming SSR, SSE, and SST using matrix in R

February 1, 2012
By
Confirming SSR, SSE, and SST using matrix in R

The codes below was done in our regression laboratory class. Here, we run first the data in SPSS, and take the ANOVA output where we can find the computed values of SSR, SSE, and SST.ANOVAb Model Sum of Squares df Mean Square F Sig. 1 Regress...

Read more »

R Training Course in the Bay Area

February 1, 2012
By
R Training Course in the Bay Area

An introduction to R for sofware developers and data analysts Saturday March 10th, 2012 8:30-5:00pm EBay 2161 North 1st Street San Jose, California I will be presenting a one day professional development workshop on R programming for software developers and … Continue reading →

Read more »

the birthday problem [X’idated]

February 1, 2012
By
the birthday problem [X’idated]

The birthday problem (i.e. looking at the distribution of the birthdates in a group of n persons, assuming a uniform distribution of the calendar dates of those birthdates) is always a source of puzzlement ! For instance, here is a recent post on Cross Validated: I have 360 friends on facebook, and, as

Read more »

RStudio Server: accessing the RStudio R IDE through your browser

February 1, 2012
By

I like having all my important documents and scripts in one single place. This saves me from having to synchronize them between the different workplaces I have, and makes backupping much less of a pain. One way of achieving this… See more ›

Read more »