Oh, and of course you need to use an explicit print inside a for loop. So, the line would be:
> print( polychor(sdi[,i], sdi[,j])) On 19/10/06, David Barron <[EMAIL PROTECTED]> wrote: > The problem is that in the expression polychor(vars[i], vars[j]), > vars[i] and vars[j] refer to the names of the variables, not the > variables themselves. So, use sdi[,i] and sdi[,j] instead. > > On 19/10/06, Kum-Hoe Hwang <[EMAIL PROTECTED]> wrote: > > Hi > > > > I have used a polycor package for categorical correlation coefficients. > > I run the following script. But there were no results. > > > > Could you tell me how to correct the script? > > > > Thanks in advance, > > > > vars <- names(sdi) > > for (i in 1:length(vars)) { > > for (j in 1:length(vars)) { > > paste(vars[i]," and ", vars[j]) > > polychor(vars[i], vars[j]) > > # corr > > } > > } > > > > > > > > -- > > Kum-Hoe Hwang, Ph.D.Phone : 82-31-250-3516Email : [EMAIL PROTECTED] > > > > ______________________________________________ > > R-help@stat.math.ethz.ch 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. > > > > > -- > ================================= > David Barron > Said Business School > University of Oxford > Park End Street > Oxford OX1 1HP > -- ================================= David Barron Said Business School University of Oxford Park End Street Oxford OX1 1HP ______________________________________________ R-help@stat.math.ethz.ch 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.