Hi all,
I need to fit a curve to data on mass gain, which follows a sigmoidal pattern and is best described using a logistic equation (based on similar published data, with which I wish to compare my data) of the form: Y = A/(1 + e^-K(d-i)) where Y = mass A = asymptotic mass K = growth rate d = age (time) i = inflection point (note ^ indicates to the power) The data I have are body mass recorded daily for several individuals (nestling birds), which will be analysed separately. I need to output the parameters (A, K, i) rather than just produce a curve. I've searched the archives and Google but haven't found instructions for how to do this (I have instructions for running this in GENSTAT but of course do not have GENSTAT). Any help would be great...but beware I am a drop-down menus and buttons person when it comes to software :-) Regards, Dean |
Dean,
Have you looked at the curvefit procedure? It has a logistic function and, although I haven't used it for quite a while, I recall that it yields coefficient values. Gene Maguin -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of DP_Sydney Sent: Wednesday, December 28, 2011 6:07 AM To: [hidden email] Subject: Fitting logistic curve to growth data Hi all, I need to fit a curve to data on mass gain, which follows a sigmoidal pattern and is best described using a logistic equation (based on similar published data, with which I wish to compare my data) of the form: Y = A/(1 + e^-K(d-i)) where Y = mass A = asymptotic mass K = growth rate d = age (time) i = inflection point (note ^ indicates to the power) The data I have are body mass recorded daily for several individuals (nestling birds), which will be analysed separately. I need to output the parameters (A, K, i) rather than just produce a curve. I've searched the archives and Google but haven't found instructions for how to do this (I have instructions for running this in GENSTAT but of course do not have GENSTAT). Any help would be great...but beware I am a drop-down menus and buttons person when it comes to software :-) Regards, Dean -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Fitting-logistic-curve-to-grow th-data-tp5105041p5105041.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Administrator
|
In reply to this post by DP_Sydney
See the NLR (Non Linear Regression) Procedure.
Following is an example of simulated data and the set up and results of NLR. Note that the parameter estimates used to generate the data are recovered quite nicely! You will wish to consult the docs on how to set up and run NLR from the dialog boxes. HTH, David --- INPUT PROGRAM. COMPUTE #K=1.5 . COMPUTE #A=4.0. COMPUTE #i= 1.7 . LOOP ID=1 TO 1000. COMPUTE d= Uniform(1)+4. COMPUTE Y=#A/(1+EXP(-#K * (d-#i)))+ UNIFORM(.01). END CASE. END LOOP. END FILE. END INPUT PROGRAM. EXE. GRAPH /SCATTERPLOT(BIVAR)=d WITH y /MISSING=LISTWISE . * NonLinear Regression. MODEL PROGRAM A=3 K=1 I=1 . COMPUTE PRED_ = A/(1+EXP(-K * (d-I))). NLR y /PRED PRED_ /CRITERIA SSCONVERGENCE 1E-8 PCON 1E-8 . All the derivatives will be calculated numerically. Iteration Residual SS A K I 1 1064.692791 3.00000000 1.00000000 1.00000000 1.1 1.348304567 3.99063649 1.49442721 1.88384875 2 1.348304567 3.99063649 1.49442721 1.88384875 2.1 .0146986193 4.00583423 1.47908955 1.69332655 3 .0146986193 4.00583423 1.47908955 1.69332655 3.1 .0080481338 4.00572338 1.47960600 1.66912002 4 .0080481338 4.00572338 1.47960600 1.66912002 4.1 .0080459976 4.00572123 1.47971278 1.66884117 5 .0080459976 4.00572123 1.47971278 1.66884117 5.1 .0080459976 4.00572119 1.47971372 1.66884238 Run stopped after 10 model evaluations and 5 derivative evaluations. Iterations have been stopped because the relative reduction between successive residual sums of squares is at most SSCON = 1.000E-08 Nonlinear Regression Summary Statistics Dependent Variable Y Source DF Sum of Squares Mean Square Regression 3 15524.41480 5174.80493 Residual 997 8.045998E-03 8.070208E-06 Uncorrected Total 1000 15524.42285 (Corrected Total) 999 .74860 R squared = 1 - Residual SS / Corrected SS = .98925 Asymptotic 95 % Asymptotic Confidence Interval Parameter Estimate Std. Error Lower Upper A 4.005721193 .001171063 4.003423162 4.008019224 K 1.479713721 .026491205 1.427728805 1.531698638 I 1.668842378 .036748380 1.596729333 1.740955424 Asymptotic Correlation Matrix of the Parameter Estimates A K I A 1.0000 -.9791 -.9656 K -.9791 1.0000 .9981 I -.9656 .9981 1.0000
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Free forum by Nabble | Edit this page |