School <- factor(1L:3L, labels = c("Bad", "Mean" , "Good"))
myCor <- q1CompSymm(School, input = "School")
coef(myCor) <- 0.26
plot(myCor, type = "cor")
## Use a data.frame with a factor
set.seed(246)
newSchool <- factor(sample(1L:3L, size = 20, replace = TRUE),
labels = c("Bad", "Mean" , "Good"))
C1 <- covMat(myCor, X = data.frame(School = newSchool),
compGrad = FALSE, lowerSQRT = FALSE)
Run the code above in your browser using DataLab