meanvals <- c(seq(3,9,2),seq(2,8,2),seq(1,7,2))
mean_matrix <- matrix(meanvals, 3, 4, byrow = TRUE,
dimnames = list(A=LETTERS[1:3], B=letters[1:4]))
mean_matrix
gencorrelationmat(mean_matrix = mean_matrix, rho = 0.7, withinf = "fB", nlfA = 3, nlfB = 4)
##correlation gradient over levels of factor B
gencorrelationmat(mean_matrix = mean_matrix, rho = c(0.7, 0.4), withinf = "fB", nlfA = 3, nlfB = 4)
##gradient both factors
rhovals <- matrix(c(0.7, 0.4), 2, 2, byrow = TRUE)
gencorrelationmat(mean_matrix = mean_matrix, rho = rhovals, withinf = "both", nlfA = 3, nlfB = 4)
Run the code above in your browser using DataLab