MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

id back, please

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55086] id back, please
  • From: "Tegla Bela" <spiller at hotmail.co.jp>
  • Date: Fri, 11 Mar 2005 04:21:59 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Greetings to all,

With your generous help I have managed to put together the following 
things:

In[180]:=
<< Statistics`NonlinearFit`

In[181]:=
<<Graphics`Graphics`
<<Graphics`Colors`

In[183]:=
func = a - 2*(a-b)/(Exp[c*(t-d)]+Exp[e*(t-d)])

In[184]:=
$HomeDirectory

In[257]:=
myfile=Import["test.csv","CSV"]

Out[257]=
{{id,age,height},{
    13,6.275,121.5},{13,7.274,128.6},{13,8.353,135.2},{13,9.29,142.4},{13,
    
10.259,146.9},{13,11.28,154.4},{13,12.329,165.3},{13,13.199,174.9},{13,14.\
196,181.1},{13,15.165,182.7},{13,16.164,185.7},{13,17.161,186.7},{13,18.031,

  
185.5},{15,6.179,105.8},{15,7.179,110.9},{15,8.257,117.1},{15,9.194,122.4},{\

15,10.163,126},{15,11.184,131.4},{15,12.233,135.8},{15,13.103,143},{
  15,14.1,152.5},{15,15.088,157.7},{15,16.077,161.5},{15,17.07,164.1},{15,
  17.947,165.5},{2,6.968,117.1},{2,7.967,123.3},{2,9.046,
    
129.4},{2,9.982,134.6},{2,10.951,139.2},{2,11.973,145.2},{2,13.021,151.1},\
{2,13.892,159.9},{2,14.888,167.8},{2,15.858,171.9},{2,16.857,175.7},{2,17.854,\

177.2},{2,18.724,175.6}}

In[258]:=
myfile1=Rest[myfile];

In[259]:=
myfile2=Split[myfile1,First[#1]==First[#2]&];

In[260]:=
alldata=Map[#[[All,{2,3}]]&,myfile2];
fitfunc =
  
(NonlinearRegress[#1,func,t,{{a,176},{b,160},{c,0.1},{d,14},{e,1.2}}]&)/@\
alldata

It should work if you hit the enter (just too long to put here) but one 
problem left for me. How can I get back the id for each set of the 
estimated parameters?

Any help, hint, suggestion apprecitated.

Regards,

spiller

_________________________________________________________________
$B3Z$7$$3(J8;z$G%3%3%mEA$o$k%a%C%;%s%8%c!<(B http://messenger.msn.co.jp/ 


  • Prev by Date: Re: RationalApproximation
  • Next by Date: Re: Determinant problem
  • Previous by thread: Re: Ver 4.0 error, "There seems to be ..." corrupts opening a notebook
  • Next by thread: LUDecomposition