First instance of correlation function. Copied from complete.R function up to the omitted NA data