R - Correlation

About

Package

Stats

# Correlation analysis of baseline measures

# Matrix of correlation
round(cor(data), 2) # Round to 2 decimal places 

# One correlation
cor(data$variable1 , data$variable2)

# Pearson's product-moment correlation test hypothesis
cor.test(data$variable1 , data$variable2)
	Pearson's product-moment correlation

data:  data$variable1 , data$variable2
t = 4.9022, df = 198, p-value = 1.969e-06
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 0.1993491 0.4473145
sample estimates:
      cor 
0.3289909 

with:


Powered by ComboStrap