From: dc353 on 22 Mar 2010 09:57 On Mar 22, 9:16 am, Paige Miller <paige.mil...(a)kodak.com> wrote: > On Mar 19, 2:05 pm, "dc...(a)hotmail.com" <dc...(a)hotmail.com> wrote: > > > the population correlation may be 0 but the sample correlation isn't. > > I'm looking to create a second random variable with sample correlation > > of 0, once that's done getting the sample correlation to equal .2 is > > relatively straightforward. > > Okay, so now you go from talking about random variables to samples. > Different animal. You simply need to take your first vector of > observations, and create a vector orthogonal to it. Simple geometry. > > > If you use the rand() function in excel > > and create two random variables you quickly see what I'm talking > > about. > > Since I never use the rand() function in Excel (and in fact, never use > Excel for anything statistical), I do not "quickly see what you are > talking about". Perhaps you could explain what you are talking about > here without referring to Excel. > > -- > Paige Miller > paige\dot\miller \at\ kodak\dot\com Paige, It's just the difference between a population statistic and a sample statistic. Use any statistical package and create two random variables with n observations. When you measure the correlation over the sample it won't be 0. As n increases the correlation will get closer and closer to 0. The distribution of sample correlations should have a mean of 0 but any one of them will be different.
From: xlr82sas on 22 Mar 2010 20:08 On Mar 22, 6:57 am, "dc...(a)hotmail.com" <dc...(a)hotmail.com> wrote: > On Mar 22, 9:16 am, Paige Miller <paige.mil...(a)kodak.com> wrote: > > > > > On Mar 19, 2:05 pm, "dc...(a)hotmail.com" <dc...(a)hotmail.com> wrote: > > > > the population correlation may be 0 but the sample correlation isn't. > > > I'm looking to create a second random variable with sample correlation > > > of 0, once that's done getting the sample correlation to equal .2 is > > > relatively straightforward. > > > Okay, so now you go from talking about random variables to samples. > > Different animal. You simply need to take your first vector of > > observations, and create a vector orthogonal to it. Simple geometry. > > > > If you use the rand() function in excel > > > and create two random variables you quickly see what I'm talking > > > about. > > > Since I never use the rand() function in Excel (and in fact, never use > > Excel for anything statistical), I do not "quickly see what you are > > talking about". Perhaps you could explain what you are talking about > > here without referring to Excel. > > > -- > > Paige Miller > > paige\dot\miller \at\ kodak\dot\com > > Paige, > > It's just the difference between a population statistic and a sample > statistic. Use any statistical package and create two random > variables with n observations. When you measure the correlation over > the sample it won't be 0. As n increases the correlation will get > closer and closer to 0. The distribution of sample correlations > should have a mean of 0 but any one of them will be different. Hi, Here is some code based on a previous post It produces Y with a ~.5 correlation with X. data p5; seed1 = 373765061; seed2 = 535327321; r=0.50; r2=r*r; do i=1 to 1000000; x = rannor(seed1); y = rannor(seed2); y = x*r + y*sqrt(1-r2); keep x y; output; end; run; proc corr data=p5; var x; with y; run; Pearson Correlation Coefficients, N = 1000000 Prob > |r| under H0: Rho=0 X Y 0.49864 <.0001
From: adjgiulio on 23 Mar 2010 15:42 Just thinking out loud. Say your known variable is X, with n observations. Create a random variable Y for the first n-1 observations of X. Then calculate the n-th value of Y so that r is whatever you want it to be. To do that, invert the r formula. r is a function of x, y and their means. If you know all values but y(n), then inverting the formula should be easy and you would end up with the exact value of r you want.
First
|
Prev
|
Pages: 1 2 Prev: Siebel Business Analyst with Pharma -- Milpitas CA Next: generate SAMPLE correlations |