
Last chance! 50% off unlimited learning
Sale ends in
Theoph
data frame has 132 rows and 5 columns of data from
an experiment on the pharmacokinetics of theophylline.Theoph
c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame")
containing the following columns:
1
, …, 12
identifying the subject on whom the observation was made. The
ordering is by increasing maximum concentration of theophylline
observed.
SSfol
, is available. This dataset was originally part of package nlme
, and that has
methods (including for [
, as.data.frame
, plot
and
print
) for its grouped-data classes.SSfol
require(stats); require(graphics)
coplot(conc ~ Time | Subject, data = Theoph, show.given = FALSE)
Theoph.4 <- subset(Theoph, Subject == 4)
fm1 <- nls(conc ~ SSfol(Dose, Time, lKe, lKa, lCl),
data = Theoph.4)
summary(fm1)
plot(conc ~ Time, data = Theoph.4,
xlab = "Time since drug administration (hr)",
ylab = "Theophylline concentration (mg/L)",
main = "Observed concentrations and fitted model",
sub = "Theophylline data - Subject 4 only",
las = 1, col = 4)
xvals <- seq(0, par("usr")[2], length.out = 55)
lines(xvals, predict(fm1, newdata = list(Time = xvals)),
col = 4)
Run the code above in your browser using DataLab