[R-sig-eco] Q10

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Tue Jan 31 12:17:23 CET 2012


Dear Alan,

There is not need to write exp(1)^b, just write is as exp(b)

Be carefull about the order in which operators are executed. ^ works for *

exp(1) ^ b * Soil.temp is equal to (exp(1) ^ b) * Soil.temp

but you wanted exp(1) ^(b * Soil.temp)

So your nls formula should be

nls(CRR ~ a*exp(b*Soil.Temp))

note that is NOT indentical to lm(log(CRR) ~ log(Soil.temp)) since the residuals are not on the same scale

Best regards,

Thierry

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx at inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

-----Oorspronkelijk bericht-----
Van: r-sig-ecology-bounces at r-project.org [mailto:r-sig-ecology-bounces at r-project.org] Namens Alan Haynes
Verzonden: dinsdag 31 januari 2012 8:26
Aan: sas0025 at auburn.edu
CC: r-sig-ecology at r-project.org
Onderwerp: Re: [R-sig-eco] Q10

Dear Lawren, Stephen and the list

Thank you both for your suggestions!

This is the code ive used in R and the error. The start values are the values derived by excel (y = 20.79e^-0.001x)

nls(CRR ~ a*exp(1)^b*Soil.Temp,
data=cloths2[cloths2$trt==1&cloths2$veg==1,], start=list(a=20.79, b=-0.001))Error in nls(CRR ~ a * exp(1)^b * Soil.Temp, data = cloths2[cloths2$trt ==  :
  singular gradient


and using lm (as per Stephens suggestion (I think you're correct too, I think I saw this answer as I looking for solutions)):

lm(log(CRR)~Soil.Temp, cloths2[cloths2$veg==1&cloths2$trt==1,])
Call:
lm(formula = log(CRR) ~ Soil.Temp, data = cloths2[cloths2$veg ==
    1 & cloths2$trt == 1, ])

Coefficients:
(Intercept)    Soil.Temp
     2.6962       0.0228



Does anyone on the list have any experience of calculating Q10 in R?
Otherwise I think Im perhaps stuck.


Cheers,

Alan


--------------------------------------------------
Email: aghaynes at gmail.com
Mobile: +41794385586
Skype: aghaynes


On 30 January 2012 18:29, Stephen Sefick <sas0025 at auburn.edu> wrote:

> linearize the model and fit.
>
> I think it is
> lny=lna+bx
>
> make sure I did the conversion correctly
>
> y=ae^bx
>
> take the natural log of both sides
>
> ln(y)=ln(ae^bx)
>
> ln(y)=a+ln(e^1)*bx
>
> ln(y)=a +bx
>
> Hopefully I did this right,
>
> Stephen
>
>
>
> On 01/30/2012 10:01 AM, Alan Haynes wrote:
>
>> Dear Ecology list,
>>
>> I'm trying to calculate the Q10 (temperature sensitivity) of 
>> decomposition in R. I have done so in excel straight forwardly enough 
>> but I want to check it in R.
>> Does anyone have any ideas how to go about this?
>>
>> It is calculated as
>>
>> y_T ~ a * e^(bx_T)
>> where y is the decomposition rate at temperature T, x_T is the 
>> temperature and "a" and "b" are constants. "e" is the magic number 
>> (exp(1) ; 2.7183)
>>
>> then
>>
>>  Q10 = exp(10*b)
>>
>> In excel I simply fit an exponential trend line, read off "b" from 
>> the formula and then calculate Q10 as above. In R it seems to be a bit harder.
>>
>> Ive attempted to use nls() to derive the exponent but I get a 
>> completely different number (when it doesnt give me a singularity 
>> error). nls() doesnt seem to like the "a" term either, as it seems to 
>> be this that generates the singularity issue.
>>
>> Does anyone know of a function, or suite of functions, for 
>> calculating Q10?
>>
>> Thanks in advance,
>>
>> Alan
>>
>>
>>
>> ------------------------------**--------------------
>> Email: aghaynes at gmail.com
>> Mobile: +41794385586
>> Skype: aghaynes
>>
>>        [[alternative HTML version deleted]]
>>
>> ______________________________**_________________
>> R-sig-ecology mailing list
>> R-sig-ecology at r-project.org
>> https://stat.ethz.ch/mailman/**listinfo/r-sig-ecology<https://stat.et
>> hz.ch/mailman/listinfo/r-sig-ecology>
>>
>
> --
> Stephen Sefick
> ****************************************************
> Auburn University
> Biological Sciences
> 331 Funchess Hall
> Auburn, Alabama
> 36849
> ****************************************************
> sas0025 at auburn.edu
> http://www.auburn.edu/~sas0025
> ****************************************************
>
> Let's not spend our time and resources thinking about things that are 
> so little or so large that all they really do for us is puff us up and 
> make us feel like gods.  We are mammals, and have not exhausted the 
> annoying little problems of being mammals.
>
>                                -K. Mullis
>
> "A big computer, a complex algorithm and a long time does not equal 
> science."
>
>                              -Robert Gentleman
>
>
>

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list