title: Fitting Redlich–Kister equation in R
body: <p>One of my friends asked for help to fit Redlich–Kister equation in R.</p>
  
  <p>I took first three columns of Table 3 from <a href="http://www.sciencedirect.com/science/article/pii/S0040603101008127" rel="nofollow noreferrer">this article</a> (also shown in Figure below) and used the following <code>R</code> code. I'm getting different results than from the article output.</p>
  
  <pre><code>Data &lt;-
  structure(list(X2 = c(0, 0.0048, 0.0086, 0.0131, 0.0188, 0.0261,
  0.0411, 0.0561, 0.0768, 0.0935, 0.1425, 0.1993, 0.2799, 0.3524,
  0.4103, 0.4553, 0.5505, 0.6562, 0.7295, 0.8186, 0.8825, 0.9584,
  1), d5 = c(0.99996, 0.9998, 0.99972, 0.99972, 0.9998, 1.00021,
  1.00129, 1.00278, 1.00486, 1.00652, 1.00968, 1.00943, 1.00453,
  0.99806, 0.99251, 0.98837, 0.97969, 0.97136, 0.96601, 0.96058,
  0.95709, 0.95345, 0.95155), V5 = c(NA, -0.015, -0.028, -0.046,
  -0.069, -0.105, -0.184, -0.274, -0.403, -0.51, -0.796, -1.037,
  -1.224, -1.274, -1.257, -1.224, -1.081, -0.874, -0.691, -0.473,
  -0.308, -0.114, NA)), .Names = c("X2", "d5", "V5"), class = "data.frame", row.names = c(NA,
  -23L))
  
  fm1 &lt;-
    lm(
    formula=
       V5 ~ -1 +
            I(X2*(1-X2)) +
            I(X2*(1-X2)*(1-2*X2)) +
            I(X2*(1-X2)*(1-2*X2)^2) +
            I(X2*(1-X2)*(1-2*X2)^3) +
            I(X2*(1-X2)*(1-2*X2)^4) +
            I(X2*(1-X2)*(1-2*X2)^5)
     , data = Data)
  
  summary(fm1)$coef
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <pre><code>                                   Estimate Std. Error     t value     Pr(&gt;|t|)
  I(X2 * (1 - X2))                  -4.636138 0.01554354 -298.267899 1.017962e-29
  I(X2 * (1 - X2) * (1 - 2 * X2))   -2.729863 0.07286814  -37.463052 3.095331e-16
  I(X2 * (1 - X2) * (1 - 2 * X2)^2) -1.695933 0.15189170  -11.165411 1.150270e-08
  I(X2 * (1 - X2) * (1 - 2 * X2)^3) -1.658202 0.39261960   -4.223432 7.371920e-04
  I(X2 * (1 - X2) * (1 - 2 * X2)^4)  3.010149 0.23867895   12.611709 2.184653e-09
  I(X2 * (1 - X2) * (1 - 2 * X2)^5)  4.492079 0.45676290    9.834596 6.220233e-08
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/8uu9Y.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/mAcUr.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/c43EM.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/0iZ5P.png" alt="enter image description here"></p>