Main page: https://www.rdocumentation.org/packages/datasets/versions/3.6.2/topics/DNase
head(DNase)
## Run conc density
## 1 1 0.04882812 0.017
## 2 1 0.04882812 0.018
## 3 1 0.19531250 0.121
## 4 1 0.19531250 0.124
## 5 1 0.39062500 0.206
## 6 1 0.39062500 0.215
require(stats); require(graphics)
coplot(density ~ conc | Run, data = DNase,
show.given = FALSE, type = "b")
coplot(density ~ log(conc) | Run, data = DNase,
show.given = FALSE, type = "b")
## fit a representative run
fm1 <- nls(density ~ SSlogis( log(conc), Asym, xmid, scal ),
data = DNase, subset = Run == 1)
## compare with a four-parameter logistic
fm2 <- nls(density ~ SSfpl( log(conc), A, B, xmid, scal ),
data = DNase, subset = Run == 1)
summary(fm2)
##
## Formula: density ~ SSfpl(log(conc), A, B, xmid, scal)
##
## Parameters:
## Estimate Std. Error t value Pr(>|t|)
## A -0.007897 0.017200 -0.459 0.654
## B 2.377239 0.109516 21.707 5.35e-11 ***
## xmid 1.507403 0.102080 14.767 4.65e-09 ***
## scal 1.062579 0.056996 18.643 3.16e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.01981 on 12 degrees of freedom
##
## Number of iterations to convergence: 0
## Achieved convergence tolerance: 2.517e-07
anova(fm1, fm2)
## Analysis of Variance Table
##
## Model 1: density ~ SSlogis(log(conc), Asym, xmid, scal)
## Model 2: density ~ SSfpl(log(conc), A, B, xmid, scal)
## Res.Df Res.Sum Sq Df Sum Sq F value Pr(>F)
## 1 13 0.0047896
## 2 12 0.0047073 1 8.2314e-05 0.2098 0.6551