code: def lpearsonr(x,y):
      
      TINY = 1.0e-30
      if len(x) != len(y):
          raise ValueError('Input values not paired in pearsonr.  Aborting.')
      n = len(x)
      x = [float(_) for _ in x]
      y = [float(_) for _ in y]
      xmean = mean(x)
      ymean = mean(y)
      r_num = n*(summult(x,y)) - sum(x)*sum(y)
      r_den = math.sqrt((n*ss(x) - square_of_sums(x))*(n*ss(y)-square_of_sums(y)))
      r = (r_num / r_den)  # denominator already a float
      df = n-2
      t = r*math.sqrt(df/((1.0-r+TINY)*(1.0+r+TINY)))
      prob = betai(0.5*df,0.5,df/float(df+t*t))
      return r, prob
docs: Calculates a Pearson correlation coefficient and the associated
  probability value.  Taken from Heiman's Basic Statistics for the Behav.
  Sci (2nd), p.195.
  
  Usage:   lpearsonr(x,y)      where x and y are equal-length lists
  Returns: Pearson's r value, two-tailed p-value