Quiz 3 (10 minutes, 3 points): Write code to a) Take 100 points from a unif dist between -1 and 1, and call it x. b) Make a y variable such that it is purely quadratic in x (i.e. y = x squared, without any noise). c) Compute the correlation between x and y, and explain why it is near zero. # a) x = runif(100,-1,1) # b) y = x^2 # c) cor(x,y) # Because r measures linear association. # Note that the correlation is nearly zero, even though plot(x,y) # shows that x and y are highly correlated. The resolution to # this "paradox" is, of course, that r measures linear correlation, # i.e., the amount of scatter about a straight line (not a parabola)