Dear All, I found this question here (http://bbs.pinggu.org/forum.php?mod=...=1#pid50990852). The end to fit a logistic function such as
The dataset and a sample code (not really working) are
The result is
Any suggestions to obtain a solution are highly appreciated.
Code:
y=k/(1+a*exp(bx)), k>0 a>0 b<0
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(x y) 167029 28706.89 161561 33845.98 185859 36910.36 218371 43732.3 258063 52074.97 291307.38 57348.29 268989.72 62685.77 286250.03 66478.91 266881 69358.89 281825.53 75624.97 end nl (y={k}/(1+{a}*exp({b}*x))), initial(k 1 a 1 b -0.1)
Code:
. nl (y={k}/(1+{a}*exp({b}*x))), initial(k 1 a 1 b -0.1) (obs = 10) Iteration 0: residual SS = 2.38e+09 Iteration 1: residual SS = 2.38e+09 Source | SS df MS -------------+---------------------------------- Number of obs = 10 Model | 0 0 . R-squared = 0.0000 Residual | 2.376e+09 9 263946028 Adj R-squared = 0.0000 -------------+---------------------------------- Root MSE = 16246.42 Total | 2.376e+09 9 263946028 Res. dev. = 221.2377 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- /k | 52676.73 5137.568 10.25 0.000 41054.75 64298.72 /a | 1 . . . . . /b | -.1 . . . . . ------------------------------------------------------------------------------ Parameter b taken as constant term in model & ANOVA table
Comment