## Analysis of associations between variables: Pearson's Product-Moment Correlation

#### Uses

• characterize the relationship between two variables with unknown dependence to determine the strength and direction of the linear association between 2 variables.

### Assumptions

• variables with unknown dependence (dependent or independent variables)
• no asumptions about causality (Correlation analysis vs. Regression analysis)
• plot of X and Y
• continuous and normally distributed (recode or transform)
• confirm homogeneity of samples

### How this is done

• Calculate Variance for 1 variable or Covariance with another
• Variance = (X- ) * (X- )
• Covariance = (X- ) * (Y- )
• Pearson's Product-Moment Correlation: Correlation coefficients are the standardized covariance between two variables. It is best used if the relationship is believed to be linear. or using an equivalent computer formula that can be calculated in a single pass of the data. • the t-statistic allows you to test for significance of the correlation coefficient. r = correlation between two variables in the entire population. Ho: r = 0; Ha: r != 0. Compare to a t-distribution and n-2. n refers to the number of paired measures.

t = ### Worksheets

 In R first import the datafile DummyData, then calculate terms for the correlation for variables "Age", "Brightness" and "Size", then report the results: > dummy <- read.table("/DummyData.txt", header=TRUE, sep="", na.strings="NA", dec=".", strip.white=TRUE) > cor.test(dummy\$Brightness, dummy\$Size, alternative="two.sided", method="pearson")