search for: sstot

Displaying 4 results from an estimated 4 matches for "sstot".

Did you mean: sslot
2004 Sep 30
1
function by
Hi, I'm just getting started with R and I'm having problems with some simple operations: I want to get the the sum of the column "SStot" for each year using the function by. The data set is named "SS". I've tried this: by (SS, year, sum(SStot)) and it's not working. Is it because there's a different number of rows for each year? How else can I do this? -- Emilie Berthiaume Graduate student Biology...
2005 Sep 08
0
Effect of data set size on calculation
...n below: # ANOVA 2D GC analysis # maxc <- number of samples # nreps <- number of samples maxc <- 2 nreps <- 4 sscl <- NULL cmean <- NULL # # Initial stat. variable # dftot <- nrow(mat)-1 dfcl <- maxc - 1 dferr <- dftot - dfcl totmean <- mean(mat) sstot <- sd(mat)^2*dftot # # Calculate class-to-class variance # for (j in 1:maxc) { cmean <- rbind(cmean,mean(mat[((j-1)*nreps+1):((j-1)*nreps+nreps),])) } for (j in 1:ncol(mat)) { cmean[,j] <- cmean[,j]-totmean[j] } cmean <- (cmean)^2*nreps for (i in 1:ncol(mat)) { sscl[i] &...
2011 Feb 21
0
r-square for cluster
...ic for a given clustering solution. In fact, I have different cluster solution for a given set of data. I would like to know which cluster solution gives the highest R2. My data (5 variables) are scaled to a 0 mean and 1 std. This is the command lines I used to calculate R2 for 1 cluster solution: SSTot <- (nrow(grid40km.datascale)-1)*sum(apply(grid40km.datascale,2,var)) # total sum of square SStot_grid40km <- NULL for (i in 1:22) # there is 22 clusters { data_group <- subset(grid40km.data,grid40km.cluster==i, select=c(X1, X2, X3, X4, X5)) SSgroup <- (nrow(data_group-1)*sum(apply(dat...
2011 Feb 27
1
two-way unbalanced ANOVA
Hello Everyone, *Question: *How do you calculate the sum of squares for a two-way _unbalanced_ ANOVA? *What I have done:* I have found many useful tutorials online for running a balanced two-way ANOVA but I haven't had much luck for running a unbalanced two-way ANOVA. From what I have read, the trouble with running an unbalanced two-way ANOVA, is that things get tricky when calculating