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
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
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
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
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
5 matches
Mail list logo