I am doing Principal Component Analysis (PCA) on assets data for household income prediction. The problem is that the assets data are rank ordered (usually binary ... possess car/don't possess car), so the normal correlation is inappropriate for the calculation of the PCA. Instead one has to use the polychoric correlation coefficient. It uses the "random.polychor.pa" package.
Scenario 1 If i only use PCA without using polychoric correlation assets.pca <- princomp(covmat = assets, scores=T) assets$income<-predict(assets2.pca)[,1] # these predict the coefficient for income for each observation Scenario 2 but when i run "hetcor" (for polychoric correlation coefficient) , and then princomp (for PCA) and finally predict ( to predict the coefficient for income for each observation). hetcor and princomp runs fine but predict command doesn't work and it doesn't predict value for each observation library(epicalc)library(foreign)library(polycor) assets.mat <- hetcor(assets, use="complete.obs")[[1]] assets.pca <- princomp(covmat = assets.mat, scores=T)assets$income<-predict(assets.pca)[,1] the problems are why this "pridict" commend throwing error in scenario 2 and not in scenario 1?Is there any other way to predict the values for each observation? thanks a lotmm [[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.