Dear Torvon, First, the number of observations is pretty much irrelevant, since polychoric correlations are computed from the contingency table for the variables.
Second, it's not obvious to me what data[c(s1,s2)] might be since this is not how one would normally call polychor(). That is, called with one argument as you've done, that argument should be a contingency table. Third, if you want to make the computation faster, you could forgo the ML estimator for the quick two-step estimator: see ?polychor. Finally, it's inconceivable to me that the computation should really take 20+ minutes, so I expect that there's an error in your command, but without a reproducible example, one can only guess at what that error is. My guess: data[c(s1,s2)] isn't a two-way contingency table. I hope this helps, John ------------------------------------------------------- John Fox Senator William McMaster Professor of Social Statistics Department of Sociology McMaster Univeristy Hamilton, Ontario, Canada > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Torvon > Sent: December-07-12 3:14 PM > To: r-help@r-project.org > Subject: [R] Polychor() - why does it take that long? > > Hello. > > Using the polychor function > > polychor(data[c(s1,s2)] ) > for polychoric correlations of two ordinal variables in R takes a long time for > N=7000 (20 minutes+) and significantly slows down my computer. > > Now, I have a pretty old computer, but it takes about 20 seconds for MPLUS > to print out the complete polychoric correlation matrix for all 16 variables, > while I am running the R function only for 2 of the 16 variables. > > Why is that? Can that process be speeded up? What makes a polychoric > correlation so much more computationally intensive than a pearson > correlation? > > Thank you > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.