pdf("ex0803.pdf") ex0803dat <- read.fwf("http://www.stat.ufl.edu/~winner/data/biostat/ex0803.dat", width=c(8,8,8), col.names=c("subj", "rnachng", "auc0_6")) ex0803 <- data.frame(ex0803dat) attach(ex0803) ex0803 # Fit the nonlinear regression model (S-shaped sunction) # For possible starting values, note: # When AUC=0, RNACHNG=0 (assuming b1 not 0) # When AUC gets huge, RNACHNG=b0 (Points flatten out at b0=4) # When AUC=b1, RNACHNG=b0/2, so set b1=18000 (where line crosses y=2) # b2 is related to steepness, try starting b2=10 (this is very steep curve) ex0803.nl1 <- nls(rnachng ~ (b0*(auc0_6^b2))/((auc0_6^b2)+(b1^b2)), start=c(b0=4, b1=18000, b2=10)) summary(ex0803.nl1) dev.off()