# R program for multivariate exercise 9 (VHM 802)
# it includes only the code to compute the -choric correlation matrix

library(foreign)
beefultra <- read.dta("r:/beef_ultra.dta")
library(polycor)
polycorr <- hetcor(beefultra[,5:12])
polycorr
polycorr$correlation
# can also try ML estimation of the correlations, and turn off some stuff
polycorrML <- hetcor(beefultra[,5:12], ML=T, std.err=F, pd=F, bins=0)
polycorrML
polycorrML$correlation
