#### WCTStats

##### New Member
Hi, I have a question I was hoping someone could answer me.

It goes as follows:
The correlation r between two variables x_1 and x_2 equals 0.33. For testing the significance of the correlation, H_0 : p = 0, the sampledistribution of the correlationcoefficient has to be determined. Wat goes for the sampledistribution of the correlation whilst testing the 0-hypothesis? The sample distribution whilst testing this hypothesis is:
a, skewed to the left
b, skewed to the right
c, symmetric around 0.33
d, symmetric around 0

(I hope I translated everything in a way that makes sense..)

I don't really understand the question so I'm hoping someone could answer it and explain why that is the answer.

#### Englund

##### TS Contributor
I'd say that the distribution of the sample correlation coefficient is independent of the null hypothesis. Can you specify exactly what confuses you?

jpg images

Code:
``````samplingdist <- function(M,n,r) {
corr <- numeric(M);
for (i in 1:M) {
x <- mvrnorm(n, rep(1, 2), matrix(c(1,r,r,1),2,2))
corr[i] <- cor(x[,1],x[,2])
}
hist(corr,freq=F,breaks=80); list(median(corr),mean(corr))
}
samplingdist(20000,100,0.33)``````
Code:
``````samplingdist <- function(M,k,n) {
corr <- numeric(M); meandiff <- numeric(k); r <- numeric(k)
for (j in 0:99) {
for (i in 1:M) {
x <- mvrnorm(n, rep(1, 2), matrix(c(1,j/100,j/100,1),2,2))
corr[i] <- cor(x[,1],x[,2])
}
r[j] <- j/100
meandiff[j] <- median(corr)-mean(corr)
}
plot(r,meandiff,ylim=c(-0.0035,0.0035)); abline(mean(meandiff),0)
}
samplingdist(1000,100,500)``````