R - Correlation

Card Puncher Data Processing

About

Statistics - Correlation (Coefficient analysis)

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:





Discover More
Card Puncher Data Processing
R - Simple Linear Regression

simple linear regression with R function such as lm Unstandardized Simple Regression Regression analyses, standardized (in the z scale). In simple regression, the standardized regression coefficient...



Share this page:
Follow us:
Task Runner