## example for PCR analysis
m1 <- pcrfit(reps, 1, 2, l5)
PRESS(m1)
## compare PRESS statistic in models
## with fewer parameters
m2 <- pcrfit(reps, 1, 2, l4)
PRESS(m2)
m3 <- pcrfit(reps, 1, 2, l3)
PRESS(m3)
## example for linear regression
x <- 1:10
y <- rnorm(10, x, 0.1)
mod <- lm(y ~ x)
PRESS(mod)
## example for NLS fitting
DNase1 <- subset(DNase, Run == 1)
fm1DNase1 <- nls(density ~ SSlogis(log(conc), Asym, xmid, scal), DNase1)
res <- PRESS(fm1DNase1)
## PRESS residuals plot
barplot(res$residuals)
Run the code above in your browser using DataLab