attach(thuesen)
lm(short.velocity~blood.glucose)
summary(lm(short.velocity~blood.glucose))
summary(lm(short.velocity~blood.glucose))
plot(blood.glucose,short.velocity)
abline(lm(short.velocity~blood.glucose))
if (.make.epsf) dev.copy2eps(file="velo-gluc-line.ps")
lm.velo <- lm(short.velocity~blood.glucose)
fitted(lm.velo)
resid(lm.velo)
options(error=expression(NULL))
plot(blood.glucose,short.velocity)
lines(blood.glucose,fitted(lm.velo))
options(error=NULL)
lines(blood.glucose[!is.na(short.velocity)],fitted(lm.velo))
cc <- complete.cases(thuesen)
options(na.action=na.exclude)
lm.velo <- lm(short.velocity~blood.glucose)
fitted(lm.velo)
segments(blood.glucose,fitted(lm.velo),
         blood.glucose,short.velocity)
if (.make.epsf) dev.copy2eps(file="velo-gluc-seg.ps")
plot(fitted(lm.velo),resid(lm.velo))
if (.make.epsf) dev.copy2eps(file="velo-gluc-resid.ps")
qqnorm(resid(lm.velo))
if (.make.epsf) dev.copy2eps(file="velo-gluc-qqnorm.ps")
predict(lm.velo)
predict(lm.velo,int="c")
predict(lm.velo,int="p")
pred.frame <- data.frame(blood.glucose=4:20)
pp <- predict(lm.velo, int="p", newdata=pred.frame)
pc <- predict(lm.velo, int="c", newdata=pred.frame)
plot(blood.glucose,short.velocity,
     ylim=range(short.velocity, pp, na.rm=T))
pred.gluc <- pred.frame$blood.glucose
matlines(pred.gluc, pc, lty=c(1,2,2), col="black")
matlines(pred.gluc, pp, lty=c(1,3,3), col="black")
if (.make.epsf) dev.copy2eps(file="velo-gluc-final.ps")
options(error=expression(NULL))
cor(blood.glucose,short.velocity)
options(error=NULL)
cor(blood.glucose,short.velocity,use="complete.obs")
cor(thuesen,use="complete.obs")
cor.test(blood.glucose,short.velocity)
cor.test(blood.glucose,short.velocity,method="spearman")
cor.test(blood.glucose,short.velocity,method="kendall")
rm(list=ls())
while(search()[2] != "package:ISwR") detach()
