[R] NLS and fitting of x-values?

Peter Dalgaard p.dalgaard at biostat.ku.dk
Mon Jun 26 14:11:03 CEST 2006


"Larsen, Thomas" <thl at dmu.dk> writes:

> I collected eggs laid by Springtails everyday over 28 days after swich to isotopically enriched diet. The eggs were pooled at day 7, 14, and 28 (+ day 0 = initial value) and analyzed for isotopes. After the diet switch the isotopic values of the adults and eggs change towards those of the new diet.
> Here are the d13C values (y) of the eggs:
> 
> x      y 
> 0   -22.2
> 0   -22.2
> 0   -22.2
> 0   -22.0
> 7   486.9
> 7   498.6
> 7   489.6
> 14  820.9
> 14  817.4
> 28  895.6
> 28  900.7
> 28  890.6
> 28  885.8
> 
> The y values represent the mean of the sampling period.
> 
> The dataset is very small but previous experiments have shown that a exponential asymptotic model can be used for this kind of situations. 
> 
> How do I fit a model to these pooled values? The y values can be regarded as the mean of the given sampling period.
> 
> My first guess is that the x values should be in the middle of the collection period. I call these x-values xi:
> xi=c(rep(0,4),rep(3.5,3),rep(10.5,2),rep(21,4))
> 
> If I fit them to a nonlinear regression model via least squares (NLS) I get the parameters:
>        Value Std. Error  t value 
> a 900.386000  3.7839900 237.9460
> b 916.630000 29.3987000  31.1792
> c   0.230811  0.0102677  22.4792
> 
> How do I procede from here? I should probably use a maximum likelihood estimate to estimate the fitted xi? 
> Any help would be greatly appreciated.

My take is that you should just have your expected y values (which in
this case are also the eggs-values, but never mind...) modeled as what
they are, namely an integral under the curve between x[i-1] and x[i],
or for practical purposes take the sum over days (say) 15 to 28 and
divide by 14. 

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-help mailing list