R: Running An Anova Over A Simple Dataframe
2
1
Entering edit mode
11.0 years ago
soosus ▴ 90

I have a dataframe of the following sort:

       NAC     cOF3     APir       Pu       Tu     V2.3     mOF3     DGpf
1 6.314770 6.181188 6.708971 6.052134 6.546938 6.079848 6.640716 6.263770
2 8.825595 8.740217 9.532026 8.919598 8.776969 8.843287 8.631505 9.053732
3 5.518933 5.982044 5.632379 5.712680 5.655525 5.580141 5.750969 6.119935
4 6.063098 6.700194 6.255736 5.124315 6.133631 5.891009 6.070467 6.062815
5 8.931570 9.048621 9.258875 8.681762 8.680993 9.040971 8.785271 9.122226
6 5.694149 5.356218 5.608698 5.894171 5.629965 5.759247 5.929289 6.092337

and want to do an ANOVA analysis using aov() or some other R function to determine which columnar categories deviate from the rest. I've look at quite a few aov() tuts but am frankly at a loss (kind of a noob). Help?

r • 7.7k views
ADD COMMENT
2
Entering edit mode
11.0 years ago
Josh Herr 5.8k

The short answer is just to learn R; learning any programming language is time consuming, but you'll find that R is something that you can pick up quickly without a programming background, but you'll have to take graduate level stats courses (I'm upset that most of my grad stat classes used SAS products).

You'll probably get a better "run-down" on what you want to do step-by-step from one of MANY online tutorials using R than what we would give you here (indeed one of the benefits of R is that there is so much material online). I would recommend these tutorials from a quick look online (but there are possibly a hundred of these!): R Tutoral ANOVA, Factorial Between Subjects ANOVA in R, An Example of ANOVA using R (with a tutorial using a data set almost identical to your data frame shown above), and Repeated measures ANOVA with R.

One of the hurdles for me learning R (and still is a challenge) was figuring out how to get my data in the correct format (much like much of bioinformatics is getting text files converted to other text files!). This may be where you are having a problem, as ANOVA is fairly straight forward in R.

I would recommend, in addition to a good statistics textbook (or many), would be to pick up a couple of good books on R (or many). I've gotten a lot of use out of R In A Nutshell, R Cookbook, and The Art of R Programming. Also the Springer R Book Series in my opinion is really great for short books on specific R topics.

ADD COMMENT
1
Entering edit mode

"much like much of bioinformatics is getting text files converted to other text files!" - So true!

ADD REPLY
1
Entering edit mode
11.0 years ago

You need to make your wide table a tall table. I suggest using the melt function from reshape2

ADD COMMENT

Login before adding your answer.

Traffic: 1987 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6