extract p-value from Tukey test and put in a Table.
0
0
Entering edit mode
3.2 years ago
FF • 0

Hi, I need to get in a list the values of p adj of multiple comparisons from Tukey test. I report the part of the script that gives me problems:

for (i in 1:1293) {

p_adjs = rep(NA, 1293)

p_adjs = matrix(p_adjs, nrow=1293, ncol=6)

if (sum(is.na(matrixDataLog[i,]))<3) {

tukey = TukeyHSD(anova)

p_adjall = tukey$Group[,4]  #p-value is in the 4th column of Tukey output

p_adjs[i,1] = p_adjall[1]

p_adjs[i,2] = p_adjall[2]

p_adjs[i,3] = p_adjall[3]

p_adjs[i,4] = p_adjall[4]

p_adjs[i,5] = p_adjall[5]

p_adjs[i,6] = p_adjall[6]

filename = "C:/tukey.txt"

write.table(p_adjs, file=filename, quote=T, sep=" ", dec=".", na="NA")

}

I have an error in p_adjs[i, 1] <- p_adjall[[1]] : number of items to replace is not a multiple of replacement length

But I want to replace one value to one value, so I don't understand. Can anyone help me to solve my problem? Thanks in advance.

extract tukey • 1.1k views
ADD COMMENT

Login before adding your answer.

Traffic: 2410 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