6.2 LOWESS

# LOWESS smoothing

source( " kuh.txt " )
kuh <- kuh/25+36

pdf("lowess1.pdf",width=5,height=5)
par(mar=c(4,4,1,1))
plot(kuh,xlab="Tag",ylab="Temperatur [°C]",cex.lab=1.2)
lines(lowess(kuh,f=2/3))
lines(lowess(kuh,f=1/3),lty=2)
dev.off()

# LOWESS smoothing

source( " kuh.txt " )
kuh <- kuh/25+36

pdf("lowess2.pdf",width=5,height=5)
par(mar=c(4,4,1,1))
plot(kuh,xlab="Tag",ylab="Temperatur [°C]",cex.lab=1.2)
lines(lowess(kuh,f=1/5))
lines(lowess(kuh,f=1/8),lty=2)
dev.off()
# LOWESS smoothing

streifen <- read.csv( " hamster.csv " )
x <- streifen[,1]
y <- streifen[,2]
a <- lowess(x,y,f=2/3)

pdf("lowess3.pdf",width=5,height=5)
par(mar=c(4,4,1,1))
plot(x,y,xlab="Anteil Winterschlaf [%]",ylab="Alter zum Todeszeitpunkt [Tage]",
cex.lab=1.2)
lines(a)
dev.off()
# LOWESS smoothing

streifen <- read.csv( " hamster.csv " )
x <- streifen[,1]
y <- streifen[,2]
a <- lowess(x,y,f=2/3)

# Residuals
r <- (y-a$y)
pdf("lowess4.pdf",width=5,height=5)
par(mar=c(4,4,1,1))
plot(x,abs(r),xlab="Anteil Winterschlaf [%]",ylab="Absolute Residuen von Alter",
cex.lab=1.2)
lines(lowess(x,abs(r),f=2/3))
dev.off()