0

I'm new to R and running into an error with the polychoric function in the psych package. I'm attempting to store the polychoric correlation matrix in a data frame from using the following syntax:

RPOL36 <- polychoric(norm.kdqol36,smooth=TRUE)

where norm.kdqol36 is a data frame with vectors of ordered variables, each with 5 levels (0, 25, 50, 75, 100). Here is an example:

0 25 50 75 100 11962 19953 4987 12998 8261

Despite each variable having 5 levels, I get this error:

Error in polychoric(norm.kdqol36, smooth = TRUE) : You have more than 8 categories for your items, polychoric is probably not needed

Could there be a formatting issue causing the polychoric function to read my variables as having more than 5 categories?

Samuel
  • 2,895
  • 4
  • 30
  • 45
Devin
  • 1
  • 1
  • 1
    Including a [minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) in your question will increase your chances of getting an answer. – Samuel Nov 12 '17 at 19:59

1 Answers1

2

polychoric assumes categorical data with fewer than 8 or so categories However, your data meet this assumption. The short term fix is to recode your 0,25,50,75,100 data into 0,1,2,3,4 (i.e. divide by 25).
I have just fixed this problem so the next release of psych (1.8.1) will do this recoding for you.

William Revelle
  • 1,200
  • 8
  • 15