search for: sqdata

Displaying 1 result from an estimated 1 matches for "sqdata".

Did you mean: sdata
2008 Jan 31
1
difficulties computing a simple anova
...lt;- read.csv("spider_data.csv") spiderdata = data.frame(Zoloft = c(9, 11, 5, 12, 15, 14, 13, 12, 7, 6), Naltrexone = c(15, 16, 12, 12, 18, 19, 23, 20, 13, 17), Valium = c(9, 11, 12, 5, 13, 15, 11, 8, 6, 9)) summary(spiderdata) # Compute a one-way ANOVA by hand J = length(spiderdata) sqdata <- data.frame((spiderdata[1] - mean(spiderdata[1])) ^ 2) for(j in 2:J) { sqdata <- cbind(sqdata, (spiderdata[j] - mean(spiderdata[j])) ^ 2) } sqdata N = 0 for(j in 1:J) { N = N + length(sqdata[[j]]) } SSW = sum(sqdata) MSW = SSW / (N - J) SSB = 0 for(j in 1:(length(spiderdata))) { SSB = SSB...