Pearson Correlation

RStudio in Chapter 10: Correlation

Code to enter:

> z <-y[is.na(y$v36)==0 & is.na(y$v7)==0,]
> cor(z$v7,z$v36)

What the code entered should look like:

What the output of the Correlation should be able to look like?

z <-y[is.na(y$v36)==0 & is.na(y$v7)==0,]
> cor(z$v7,z$v34)
[1] 0.3540245

Chapter 10: Correlation SPSS

  1. Analyze → Correlate → Bivariate
  2. Transfer both the independent and the dependent variables into variables category
  3. Check Pearson under correlation coefficients
  4. Click Okay