# Set up two submatrices
matU <- matrix(c(
0.1, 0,
0.2, 0.4
), byrow = TRUE, nrow = 2)
matF <- matrix(c(
0, 4,
0., 0.
), byrow = TRUE, nrow = 2)
# errors as 95% CI, with a sample size of 20 for all elements
calculate_errors(mat_U = matU, mat_F = matF, sample_size = 20, type = "CI95")
# errors as sem, with a sample size of 20 for all elements
calculate_errors(mat_U = matU, mat_F = matF, sample_size = 20, type = "sem")
# Sample size is a single matrix applied to both F and U matrices
ssMat <- matrix(10, nrow = 2, ncol = 2)
calculate_errors(
mat_U = matU, mat_F = matF, sample_size = ssMat, type =
"sem"
)
# Sample size is a list of two matrices, one for F and one for U.
ssMats <- list(
"mat_F_ss" = matrix(10, nrow = 2, ncol = 2),
"mat_U_ss" = matrix(10, nrow = 2, ncol = 2)
)
calculate_errors(
mat_U = matU, mat_F = matF, sample_size = ssMats, type =
"sem"
)
Run the code above in your browser using DataLab