title: Fit sigmoidal curve to data in R
body: <p>I would like to fit a sigmoidal function to my data, I have tried according to a similar matter like here:
  <a href="https://stackoverflow.com/questions/33033176/using-r-to-fit-a-sigmoidal-curve">Using R to fit a Sigmoidal Curve</a>
  The problem is that my curve is too flat, so it does not reach the upper point of my data (I want it to go to 2 at least or 2.3 on the y-axis and then leave the diagram). Do you have any hint what I have to change in my code?</p>
  
  <p>Thanks in advance!</p>
  
  <p>Here the data (its actually more points, so it would look wired if the fitted curve would just reach y-values of 1.5):</p>
  
  <pre><code>T&lt;- c(1.45151262, 1.23861251, 2.25986937, 1.50269889, 1.96593223, 1.25365243, 1.98465413, 1.96593223, 0.98585134, 1.45151262,  1.23861251, 2.25986937, 1.96593223, 1.96593223, 2.53257897, 0.53892040, 0.39919629,  0.49431555, 0.37490131,  0.61959698,  1.30069888,  0.34356933,  0.32231250,  0.60307860,  0.46739360,  0.23849933,  0.22491460, 0.18751264,  0.43795313,  0.35338655,  0.44306278, -0.04577398,  0.23924335,  0.36656968,  0.17550798,  0.39912386, 0.86993214,  0.70492281,  1.09849071,  1.49913528,  0.99460365,  0.48011272,  0.73764538,  2.04877202,  0.88241166,1.08291537,  1.58361191,  1.20293826,  1.37084470)
  
  W&lt;-c(-1.100000, -1.150000, -0.850000, -0.850000, -0.650000, -0.700000, -0.650000, -0.650000, -0.700000, -1.100000, -1.150000, -0.850000, -0.650000, -0.650000, -0.750000, -1.250000, -1.350000, -1.200000, -1.266667, -0.950000, -1.000000, -1.150000, -1.100000, -1.150000, -1.200000, -2.000000, -1.700000, -1.550000, -2.150000, -1.850000, -1.600000, -1.500000, -1.500000, -1.550000, -1.700000, -0.650000, -0.550000, -1.100000, -0.500000, -0.950000,       -0.950000, -0.800000, -1.050000, -0.600000, -0.750000, -1.200000, -0.700000, -0.600000, -0.950000)
  </code></pre>
  
  <p>The code I used:</p>
  
  <pre><code>plot(T~W)
  
  M1 &lt;- nls(T ~a/(1 + exp(-b * (W-c)) ), start=list(a=2.5,b=1,c=-1))
  
  lines(seq(-6,0, length.out = 100), predict(M1, newdata = data.frame(W = seq(-6,0, length.out = 100))))
  </code></pre>