---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- # [ source("http://macosa.dima.unige.it/r.R") ] # Comment on "cor.test". # H = c(15,20,39,52); F = c(260,380,710,990) cor.test(H,F, conf.level=0.90) # # Pearson's product-moment correlation # # data: H and F # t = 28.471, df = 2, p-value = 0.001231 # alternative hypothesis: true correlation is not equal to 0 # 90 percent confidence interval: # 0.9674734 0.9999541 # sample estimates: # cor # 0.9987686 # # Pearson: test based on Pearson's method # df: "degrees of freedom" (amount of data decreased by two) # p-value; probability of obtaining this "cor" with such a quantity of data in the # hypothesis that the two variables were totally unrelated (ie cor was actually 0) # (1 - 0.0012314 = 0.9987686) # t is cor(H,F)*sqrt(n-2)/sqrt(1-cor(H,F)^2) where n = length(H); it is used in # estimating some parameters