Thursday, 26 February 2015

Doing a T-test across a data frame...

Useful info here:

https://www.biostars.org/p/82583/

Key script from this is:
pvals=apply(d,1,function(x) {t.test(x[1:2],x[3:5])$p.value})


and here:
http://statistics.berkeley.edu/computing/r-t-tests

> names(ttest)
[1] "statistic"   "parameter"   "p.value"     "conf.int"    "estimate"
[6] "null.value"  "alternative" "method"      "data.name"

Covariance function...

http://stackoverflow.com/questions/9800088/using-coefficient-of-variation-in-aggregate-r

file.choose()

This is a nice little command

The option file.choose() will pop open a dialog that allows the user to browse through their directory structure in an accustomed manner. Locate the file USTemperatures.txt in your directory structure, then click the Open button

> USTemps=read.table(file=file.choose(),header=TRUE)
I found out about it from here:
http://msenux.redwoods.edu/math/R/TransformingData.php

Correcting for multiple testing...

According to Aled's paper

Row by row T-tests
correcting for multiple testing with Benajmini Hochberg.
Here is a link to the Wikipedia article on False Discover Rates: http://en.wikipedia.org/wiki/False_discovery_rate

Here is the R-documentation:
https://stat.ethz.ch/R-manual/R-devel/library/stats/html/p.adjust.html

I'm quite confused about all of this!!!