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.
You could estimate the population contingency table with
survey::svytableand then feed it topolycor::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::withReplicatesto repeat the procedure above for each replicate.