title: Calculation of R2
body: <p>I try to find the coefficient of determination (R2) with thes values :
  valeur_T= [45, 77, 102]</p>
  
  <p>valeur_min = [55, 80, 105]</p>
  
  <p>I try to calculate R2 but I always find the same result</p>
  
  <pre><code>        P2 = polyfit(valeur_T,valeur_min, 2)
          p= poly1d(P2)
          yhat = p(valeur_T)
          ybar = sum(valeur_min)/len(valeur_min)
          SST = sum((valeur_min - ybar)**2)
          SSreg = sum((yhat - ybar)**2)
  
          R2 = SSreg/SST
  </code></pre>
  
  <p>SST and SSreg always have the same values and R2=1</p>
  
  <p>where is my error ?</p>