Re: [R] qbinom

2012-12-01 Thread peter dalgaard
On Dec 1, 2012, at 01:00 , David Winsemius wrote: > > On Nov 30, 2012, at 1:05 PM, jaybell wrote: > >> sorry, I repost the question again > > Why? This was already answered. > >> >> a=c(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9) >> b=c(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1) >> co

Re: [R] qbinom

2012-11-30 Thread David Winsemius
On Nov 30, 2012, at 1:05 PM, jaybell wrote: > sorry, I repost the question again Why? This was already answered. > > a=c(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9) > b=c(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1) > cor(a,b)= -1 > > pa=qbinom(a, 1, 0.5) > pb=qbinom(b, 1, 0.5) > cor(

Re: [R] qbinom

2012-11-30 Thread jaybell
sorry, I repost the question again a=c(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9) b=c(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1) cor(a,b)= -1 pa=qbinom(a, 1, 0.5) pb=qbinom(b, 1, 0.5) cor(pa,pb)=-0.8 but when pa=qbinom(a,10,0.5) pb=qbinom(b,10,0.5) cor(pa,pb) becomes -1 again --

Re: [R] qbinom

2012-11-30 Thread Peter Langfelder
On Fri, Nov 30, 2012 at 9:47 AM, jaybell wrote: > a=c(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9) > b=c(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1) > cor(a,b)= -1 > > a'=qbinom(a, 1, 0.5) > b'=qbinom(b, 1, 0.5) > why cor(a',b') becomes -0.5 ? On my computer the correlation is -0.8. It is not 1