gencovariancemat | R Documentation |
May be run independently or internally as part of 'calculate_mean_matrix'.
gencovariancemat(
correlation_matrix,
sd_matrix,
withinf,
label_list = NULL,
nlfA,
nlfB
)
correlation_matrix |
Matrix - Expected correlation between combinations of factor levels |
sd_matrix |
Numeric or matrix - Standard deviation value or matrix of standard deviation values for combinations of factor levels. |
withinf |
Character- Factor for which measurements are repeated, options are NULL, "fA", "fB" and "both". If NULL (default) independent measurements will be considered. |
label_list |
List length 2 - Names of factor levels |
nlfA |
Integer - number of levels of factor A |
nlfB |
Integer - number of levels of factor B |
Covariance matrix
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
sd_matrix <- mean_matrix*0.2
cor_matrix <- gencorrelationmat(mean_matrix = mean_matrix,
rho = 0.7, withinf = "fB", nlfA = 3, nlfB = 4)
gencovariancemat(cor_matrix, sd_matrix, withinf = "fB", nlfA = 3, nlfB = 4)
##correlation gradient over levels of factor B
cor_matrix <- gencorrelationmat(mean_matrix = mean_matrix,
rho = c(0.7, 0.4), withinf = "fB", nlfA = 3, nlfB = 4)
gencovariancemat(cor_matrix, sd_matrix, withinf = "fB", nlfA = 3, nlfB = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.