correlations with significance levels

I want to calculate how significant a correlation is

I use this code for the correlation. How can I see if this correlation is statistically significant?
I guess I can use this code, but I have to add something.
cor(data$variable1,data$variable2)

x <- c(6,7,8,17,12,16)
y <- c(33.46,50.68,87.92, 98.84, 63.6, 107.3)
cor(x, y, method = c("pearson"))
cor.test(x, y, method=c("pearson"))

The result is a 2 tailed p value. Take half of it. If the half is less than your significance level alpha, then the null hypothesis of no correlation is rejected/

cor.test(data$variable1,data$variable2)

should do the job too, right?

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.