search for: sstot_grid40km

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

2011 Feb 21
0
r-square for cluster
...a. 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(data_group,2,var))) # SS for all variables for a given cluster SStot_grid40km=append(SStot_grid40km, SSgroup,afte...