Re: how to create dataset with given correlation coefficient
- From: glenbarnett@xxxxxxxxxxxxx
- Date: 25 May 2005 19:46:19 -0700
Start with X and Z iid N(0,1).
If W = aX + bZ, then cov(W,X) = a var(X).
E(W) = aE(X)+bE(Z) = 0
var(W) = a^2 + b^2.
cov(W,X) = cov(aX+bZ,X) = a var(X)+0 = a
If |a|<1 and you choose b to make W have variance 1, then
corr(W,X) = a
You can then choose Y to be a linear function of W to achieve the
desired population std dev. and mean.
Glen
.
- Follow-Ups:
- Re: how to create dataset with given correlation coefficient
- From: Reef Fish
- Re: how to create dataset with given correlation coefficient
- References:
- how to create dataset with given correlation coefficient
- From: pcatchen
- how to create dataset with given correlation coefficient
- Prev by Date: Re: how to create dataset with given correlation coefficient
- Next by Date: Re: Ian Stewart's Web Pages?
- Previous by thread: Re: how to create dataset with given correlation coefficient
- Next by thread: Re: how to create dataset with given correlation coefficient
- Index(es):
Relevant Pages
|