Nitren {NRAIA} | R Documentation |
The Nitren
data frame has 26 rows and 5 columns from an experiment
in cardiology.
This data frame contains the following columns:
Bates and Watts (1998), Nonlinear Regression Analysis and Its Applications, Wiley (Appendix A1.5).
matplot(Nitren[, 1], Nitren[, -1], las = 1, xlab = "log(NIF concentration)", ylab = "reaction level", main = paste("Nitren data and fitted curves,", "omitting zero concentration data")) ## without the data at NIF concentration of zero options(na.action = na.omit) fm1 <- nls(tiss1 ~ SSfpl(log.NIF, A, B, xmid, scal), Nitren) fm1 fm2 <- nls(tiss2 ~ SSfpl(log.NIF, A, B, xmid, scal), Nitren) fm2 fm3 <- nls(tiss3 ~ SSfpl(log.NIF, A, B, xmid, scal), Nitren) fm3 fm4 <- nls(tiss4 ~ SSfpl(log.NIF, A, B, xmid, scal), Nitren) fm4 usr <- par("usr") xx <- seq(usr[1], usr[2], len = 50) lines(xx, predict(fm1, list(log.NIF = xx)), col = 1, lty = 2) lines(xx, predict(fm2, list(log.NIF = xx)), col = 2, lty = 2) lines(xx, predict(fm3, list(log.NIF = xx)), col = 3, lty = 2) lines(xx, predict(fm4, list(log.NIF = xx)), col = 4, lty = 2) title(sub = deparse(fm1$call$formula)) ## replacing the data at NIF concentration of zero by a very small value log.NIF <- Nitren[, 1] log.NIF[ is.na(log.NIF) ] <- -18 Nitren[, 1] <- log.NIF matplot(Nitren[, 1], Nitren[, -1], las = 1, xlab = "log(NIF concentration)", ylab = "reaction level", main = paste("Nitren data and fitted curves", "- zero concentration recoded as -18")) fm1 <- nls(tiss1 ~ SSfpl(log.NIF, A, B, xmid, scal), Nitren) fm1 fm2 <- nls(tiss2 ~ SSfpl(log.NIF, A, B, xmid, scal), Nitren) fm2 fm3 <- nls(tiss3 ~ SSfpl(log.NIF, A, B, xmid, scal), Nitren) fm3 fm4 <- nls(tiss4 ~ SSfpl(log.NIF, A, B, xmid, scal), Nitren) fm4 usr <- par("usr") xx <- seq(usr[1], usr[2], len = 50) lines(xx, predict(fm1, list(log.NIF = xx)), col = 1, lty = 2) lines(xx, predict(fm2, list(log.NIF = xx)), col = 2, lty = 2) lines(xx, predict(fm3, list(log.NIF = xx)), col = 3, lty = 2) lines(xx, predict(fm4, list(log.NIF = xx)), col = 4, lty = 2) title(sub = deparse(fm1$call$formula))