Is the following helpful? pdd<-deriv(~a+(b-a)/(1+exp((c-t)/d)),"d") > pdd expression({ .expr1 <- b - a .expr2 <- c - t .expr4 <- exp(.expr2/d) .expr5 <- 1 + .expr4 .value <- a + .expr1/.expr5 .grad <- array(0, c(length(.value), 1L), list(NULL, c("d"))) .grad[, "d"] <- .expr1 * (.expr4 * (.expr2/d^2))/.expr5^2 attr(.value, "gradient") <- .grad .value })
Or perhaps you want it with respect to "t"? JN
Message: 46 Date: Mon, 19 Oct 2009 14:50:15 +0100 From: "Weber, Sam" <sam.we...@exeter.ac.uk> Subject: [R] How to get slope estimates from a four parameter logistic with SSfpl? To: "r-help@R-project.org" <r-help@r-project.org> Message-ID: <5bb78285b60f9b4db2c6a4da8f3e788c12c64b3...@exchmbs04.isad.isadroot.ex.ac.uk> Content-Type: text/plain Hi, I was hoping to get some advice on how to derive estimates of slopes from four parameter logistic models fit with SSfpl. I fit the model using: model<-nls(temp~SSfpl(time,a,b,c,d)) summary(model) I am interested in the values of the lower and upper asymptotes (parameters a and b), but also in the gradient of the line at the inflection point (c) which I assume tells me my rate of increase when it is steepest (?). However, I cannot work out how to derive a slope estimate. I'm guessing it has something to do with the scaling parameter d but having searched the internet for hours I have not made any progress, and it is probably quite simple. Any help would be hugely appreciated! All the best Sam
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.