[R] Extract model from deriv3 or nls

Riley, Steve Steve.Riley at pfizer.com
Thu Sep 18 15:33:24 CEST 2014


Hello!

I am trying to figure out how to extract the model equation when using deriv3 with nls.

Here is my example:
#
#             Generate derivatives
#
Puro.fun2 <- deriv3(expr = ~(Vmax + VmaxT*state) * conc/(K + Kt * state + conc),
                    name = c("Vmax","VmaxT","K","Kt"),
                    function.arg = function(conc, state, Vmax, VmaxT, K, Kt) NULL)
#
#             Fit model using derivative function
#
Puro.fit1 <- nls(rate ~ Puro.fun2(conc, state == "treated", Vmax, VmaxT, K, Kt),
                 data = Puromycin,
                 start = c(Vmax = 160, VmaxT = 47, K = 0.043, Kt = 0.05))

Normally I would use summary(Puro.fit1)$formula to extract the model but because I am implementing deriv3, the following gets returned:

> summary(Puro.fit1)$formula
rate ~ Puro.fun2(conc, state == "treated", Vmax, VmaxT, K, Kt)

What I would like to do is find something that returns:

rate ~ (Vmax + VmaxT*state) * conc/(K + Kt * state + conc)

Is there a way to extract this? Please advise. Thanks for your time.

Steve
860-441-3435


	[[alternative HTML version deleted]]



More information about the R-help mailing list