Polychoric matrices out of complex survey data in R

44 Views Asked by At

I'm using R to analyze data from surveys with complex designs. Therefore, I'm utilizing the survey package. Is there a way to obtain polychoric correlation matrices in R while taking into account the complex sample design of my data (i.e., I need to use sampling weights)?

The svycor() function from the jtools package only allows for obtaining Pearson correlation matrices. And the weightedCorr() function from the wCorr package only allows for obtaining correlations weighted by a single weight and for pairs of variables (not entire matrices at once).

Thank you in advance.

1

There are 1 best solutions below

0
Thomas Lumley On

You could estimate the population contingency table with survey::svytable and then feed it to polycor::polychor.

If you need standard errors, the only way I can think of at the moment is to use replicate weights. That is, use survey::withReplicates to repeat the procedure above for each replicate.