Basic Stats Question Regarding Coefficient Correlation and For Loops


If I have two vectors that represent random variables,


x<-rnorm(100000) y<-rexp(100000)

What would be the code to compute the correlation coefficient between the two vectors using for loops? I am fairly new to R so a simpler answer would be better. Thank you.

Can you explain why you need to have for loop in here? What type of correlation do you want to calculate? One vector with another? Then you don't need to use for loop, you can just compute it directly.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.