Re: [R] use logical in cor.test

2010-03-30 Thread pgseye
Many thanks Peter, This did indeed work. Regards, Paul -- View this message in context: http://n4.nabble.com/use-logical-in-cor-test-tp1744701p1746008.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing li

Re: [R] use logical in cor.test

2010-03-30 Thread Peter Ehlers
On 2010-03-30 2:41, pgseye wrote: Thanks for the replies. In response to Erik: What does Both[,1] show you? Both[,1] [1] 3.36 NA NA NA NA NA NA 3.92 3.50 NA NA NA NA 3.76 3.19 3.83 NA 3.66.. What does Both[,1]> 2.5 show you? Both[,1]>2.5 [1] TR

Re: [R] use logical in cor.test

2010-03-30 Thread pgseye
Thanks for the replies. In response to Erik: What does > Both[,1] show you? > Both[,1] [1] 3.36 NA NA NA NA NA NA 3.92 3.50 NA NA NA NA 3.76 3.19 3.83 NA 3.66.. What does > Both[,1] > 2.5 show you? > Both[,1]>2.5 [1] TRUENANANANANAN

Re: [R] use logical in cor.test

2010-03-29 Thread Bill.Venables
What you have done is calculate correlations between two binary variables. You say you wanted to calculate the correlation between two truncated variables. One way to do this here is to make a temporary copy setting the excluded values to missing, e.g.: > tBoth <- Both > is.na(tBoth[tBoth > 2

Re: [R] use logical in cor.test

2010-03-29 Thread Erik Iverson
cor.test(Both[,1],Both[,2]) What does > Both[,1] show you? cor.test(Both[,1]>2.5,Both[,2]>2.5) What does > Both[,1] > 2.5 show you? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting