[R] analysis of variance test

Nezahat HUnter nezahathunter at yahoo.co.uk
Thu May 28 23:16:27 CEST 2015

Let's say I have 12 observation of 5 variables and my first variable is categorical (with 4 different levels). I am trying to find out statistical significance difference between these categorical levels for each variable, but my  function is not working! Please note that my data "x" are in data.frame format.
Any suggestion would be helpful.Many thanks.

    x1 <- numeric
    x2 <- numeric
    for(i in 2:length(x)) {
        x1[i] <- summary(aov(x[, i] ~ factor(x[, 1])))
        x2[i] <- x1[i]$Pr[1]  #Pr is the probability values
        if(x2[i] < 0.06)
            x2[i] <- 1
        else x2[i] <- 0    

	[[alternative HTML version deleted]]

More information about the R-help mailing list