Open
Description
I have ordinal data and want to estimate a polychoric correlation matrix (and export to Excel). However, when I submit my data to the procedure with method="polychoric"
i get:
dat <- c(1, 1, 1, 1, 0,
1, 1, 1, 2, 1,
1, 2, 1, 2, 0,
1, 1, 0, 2, 0,
2, 2, 2, 2, 1,
1, 1, 2, 2, 1,
1, 0, 0, 0, 1,
1, 1, 0, 1, 1,
1, 1, 1, 1, 0,
1, 1, 1, 1, 1)
df <- data.frame(matrix(dat,ncol=5, byrow=T))
correlation::correlation(df, method = "polychoric")
#> Error: No random effects terms specified in formula.