Please consider the following R Script:
       x = c(1,2,3)
       y = c(1,2,9)
       cor(x,y)
These three lines will produce, as I expected, the correlation between the variables x and y. However, R is going to assume that the probability that x = 1 is the same as the probability that x = 2. Suppose I know the probability that x = 1 is 0.5 and the probability that x = 2 (or x = 3 ) is 0.25. I believe that would effect the correlation between the variables x and y. How do I tell R about these probabilities?

I thank the group in advance for their responses to this post.

Bob

______________________________________________
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.

Reply via email to