I am trying to fit the following data set using non-linear regression where v=rate, s=substrate conc and I=inhibitor conc
v s I
1 0.030735 20 0
2 0.036813 30 0
3 0.043511 40 0
4 0.049580 60 0
5 0.053996 70 0
6 0.059996 80 0
7 0.064517 100 0
8 0.062283 120 0
9 0.069128 150 0
10 0.070157 180 0
11 0.010265 20 5
12 0.012665 30 5
13 0.016841 40 5
14 0.020061 60 5
15 0.023298 70 5
16 0.025832 80 5
17 0.026651 100 5
18 0.028431 120 5
19 0.030125 150 5
20 0.039977 180 5
21 0.009380 20 6
22 0.012413 30 6
23 0.016107 40 6
24 0.020513 60 6
25 0.021588 70 6
26 0.023146 80 6
27 0.026004 100 6
28 0.024654 120 6
29 0.026586 150 6
30 0.032169 180 6
31 0.008452 20 7
32 0.011441 30 7
33 0.015973 40 7
34 0.017618 60 7
35 0.019015 70 7
36 0.021235 80 7
37 0.024005 100 7
38 0.025089 120 7
39 0.025360 150 7
40 0.028029 180 7
41 0.007178 20 8
42 0.010141 30 8
43 0.012837 40 8
44 0.019752 60 8
45 0.019955 70 8
46 0.020838 80 8
47 0.021742 100 8
48 0.021748 120 8
49 0.024367 150 8
50 0.027416 180 8
51 0.008012 20 10
52 0.009509 30 10
53 0.012265 40 10
54 0.013161 60 10
55 0.014029 70 10
56 0.014719 80 10
57 0.018321 100 10
58 0.020250 120 10
59 0.021642 150 10
60 0.026193 180 10
To the following equation using the nls function, the initial values are very close to the actual values as I calculated them earlier and defined them.
mm.competitive.formula <- as.formula(v ~ ((Vmax*s)/ (Km*(1+(I/Ki)+s))))
mm.competitive <- nls(mm.competitive.formula, kinetics, start=list(Km=Ki.initial, Vmax=Vmax.initial, Ki=Ki.initial))
summary(mm.competitive)
However I keep getting the following error:
Error in model.frame.default(formula = ~v + s + I, data = list(rate = c(0.030735, :
variable lengths differ (found for 's')
Because for each substrate concentration i have got 6 observations, one for each inhibitor conc. But for each inhibitor conc I have 10 substrate concentrations (at least from my readings on the error I think this is the case, I might be wrong). I dont want to leave out any data, so i am unsure how to get around this issue.
structure(list(v = c(0.030735, 0.036813, 0.043511, 0.04958, 0.053996,
0.059996, 0.064517, 0.062283, 0.069128, 0.070157, 0.010265, 0.012665,
0.016841, 0.020061, 0.023298, 0.025832, 0.026651, 0.028431, 0.030125,
0.039977, 0.00938, 0.012413, 0.016107, 0.020513, 0.021588, 0.023146,
0.026004, 0.024654, 0.026586, 0.032169, 0.008452, 0.011441, 0.015973,
0.017618, 0.019015, 0.021235, 0.024005, 0.025089, 0.02536, 0.028029,
0.007178, 0.010141, 0.012837, 0.019752, 0.019955, 0.020838, 0.021742,
0.021748, 0.024367, 0.027416, 0.008012, 0.009509, 0.012265, 0.013161,
0.014029, 0.014719, 0.018321, 0.02025, 0.021642, 0.026193), s = c(20L,
30L, 40L, 60L, 70L, 80L, 100L, 120L, 150L, 180L, 20L, 30L, 40L,
60L, 70L, 80L, 100L, 120L, 150L, 180L, 20L, 30L, 40L, 60L, 70L,
80L, 100L, 120L, 150L, 180L, 20L, 30L, 40L, 60L, 70L, 80L, 100L,
120L, 150L, 180L, 20L, 30L, 40L, 60L, 70L, 80L, 100L, 120L, 150L,
180L, 20L, 30L, 40L, 60L, 70L, 80L, 100L, 120L, 150L, 180L),
I = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10)), row.names = c(NA, -60L), class = "data.frame")