From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>

Date: Sat 02 Jul 2005 - 18:52:33 EST

Date: Sat 02 Jul 2005 - 18:52:33 EST

"Jim Brennan" <jfbrennan@rogers.com> writes:

> OK now I am skeptical especially when you say in a weird way:-)

*> This may be OK but look at plot(x,y) and I am suspicious. Is it still
**> alright with this kind of relationship?
*

...

*> N <- 10000
*

> rho <- .6

*> x <- runif(N, -.5,.5)
**> y <- x * sample(c(1,-1), N, replace=T, prob=c((1+rho)/2,(1-rho)/2))
*

Well, the covariance is (everything has mean zero, of course)

E(XY) = (1+rho)/2*EX^2 + (1-rho)/2*E(X*-X) = rho*EX^2

In summary, EXY/sqrt(EX^2EY^2) == rho

-- O__ ---- Peter Dalgaard ุster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 ______________________________________________ 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.htmlReceived on Sat Jul 02 18:54:44 2005

*
This archive was generated by hypermail 2.1.8
: Fri 03 Mar 2006 - 03:33:11 EST
*