Question: Running ANOVA in R on 4 different groups
0
10 months ago by
janainamace10
Brazil
janainamace10 wrote:

Hello everyone

I'm starting to use R to analyze proteomic data. I have 4 different groups and I would like to compare differentially expressed proteins. I would like to apply a One-way ANOVA followed by a Tukey post hoc test.

My data is organized as follows:

``````Group.......... Protein 1.......... Protein 2 ......Protein3025
A
A
B
B
C
C
D
D

data\$Group <- factor(data\$Group, levels=c("A","B","C", "D"))

data\$Group
> [1] A A B B  C C  D D
> Levels: A B C D
myformula <- " ~ Group"

for (i in 2:ncol(data))
{
formula <- paste(colnames(data)[i], myformula, sep="")
p <- summary(aov(as.formula(formula), data=data))[[1]][["Pr(>F)"]][1]
print(paste(formula, ": p=", p, sep=""))
}

>[1] "Q9C075 ~ Group: p=0.000525021327472293"
>[1] "Q6A162 ~ Group: p=0.000525021327472293"
>[1] "O76009 ~ Group: p=0.000525021327472293"
>[1] "P0DN37 ~ Group: p=0.000389600632838321"
>[1] "P0DN26 ~ Group: p=0.000389600632838321"
>[1] "F5H284 ~ Group: p=0.000389600632838321"
``````

....

So far, I have this result, but I would like to know which proteins are regulated in all comparisons, that is, AB, AC, AD, BC, DC. Can someone help me? Is this approach correct?

R • 284 views
modified 10 months ago by Kevin Blighe69k • written 10 months ago by janainamace10
1
10 months ago by
Kevin Blighe69k
Republic of Ireland
Kevin Blighe69k wrote:

You will want to use Dunn's post-hoc test, which will test the pairwise comparisons between all possible groups as part of non-parametric ANOVA (Kruskal-Wallis test). The `dunntest()` function is part of the FSA package (CRAN). I trust that you will be able to look at the documentation and devise your own code from there.

Kevin

1

Thank you so much Kevin! You helped me a lot.

1

Sure thing my friend / Valeu