Sta 106 Homework V.docx - Appendix 1a)Find nt a b >the.data...

This preview shows page 1 - 14 out of 16 pages.

Appendix: 1a)Find nt, a , b >the.data = rat >names(the.data) = c("Y","A","B") >find.means = function(the.data,fun.name = mean){ a = length(unique(the.data[,2])) b = length(unique(the.data[,3])) means.A = by(the.data[,1], the.data[,2], fun.name) means.B = by(the.data[,1],the.data[,3],fun.name) means.AB = by(the.data[,1],list(the.data[,2],the.data[,3]),fun.name) MAB = matrix(means.AB,nrow = b, ncol = a, byrow = TRUE) colnames(MAB) = names(means.A) rownames(MAB) = names(means.B) MA = as.numeric(means.A) names(MA) = names(means.A) MB = as.numeric(means.B) names(MB) = names(means.B) results = list(A = MA, B = MB, AB = MAB) return(results) } >a = length(unique(the.data$A)) >b = length(unique(the.data$B)) >nt = nrow(the.data) 1b)Find values of SSE for AB, A+B

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture