I have measured growth rates over a range of temperatures (temperature response curve) and would like to fit an already established equation/model to it. I'm very new to R and have trouble coding it right.
This is my data:
x <- c(37.8,
34.8,
32.25,
29.65,
26.75,
24.4,
21.45,
19.15,
16.2,
13.7,
10.95,
8.2,
5.4)
y <- c(0.0381,
0.018133333,
1.057033333,
2.3395,
2.5188,
2.6132,
2.398466667,
2.082966667,
1.687366667,
1.389233333,
0.9835,
0.639833333,
0.3757)
The equation I'm trying to fit is as follows:
$y=(3.5-x/10)(x/25)^{(5/2)}$
There is also another data set:
x2 <- c(34.8, 32.25, 29.65, 26.75, 24.4, 21.45, 19.15, 16.2, 5.4)
and
y2 <- c(0.033966667, 1.5153, 2.226266667, 2.3462, 2.096766667, 2.0986, 1.941866667, 1.5183, 0.2717)
I tried modifing code that I found here to my equation but have been unsuccessful so far. Can someone help with this with a step by step guide for dummies?
Updated model for my dataset: nls(y~((Tmax-x)/(Tmax-Topt))*(((x/Topt)^((Topt/(Tmax-Topt)))))
$$y = Y_{max}\frac{T_{max}-x}{T_{max}-T_{opt}}\left(\frac{x}{T_{opt}}\right)^{(T_{opt}/(T_{max}-T_{opt}))}$$