Skip to content

Instantly share code, notes, and snippets.

@ccadek
Created May 25, 2017 09:43
Show Gist options
  • Save ccadek/98fec5684a40fe1168d2b7b313d5a35d to your computer and use it in GitHub Desktop.
Save ccadek/98fec5684a40fe1168d2b7b313d5a35d to your computer and use it in GitHub Desktop.
x <- as.numeric(flu1$Date)
y <- flu1$Paraguay
a <- lowess(x,y,f=2/3)
yhat <- a$y
r <- y-yhat
rplus <- lowess(x[sign(r)==1],yhat[sign(r)==1],f=2/3)$y
rminus <- lowess(x[sign(r)==-1],yhat[sign(r)==-1],f=2/3)$y
plot(x,y,xlab="Anteil Winterschlaf [%]",ylab="Alter zum Todeszeitpunkt [Tage]")
lines(x[sign(r)==1],yhat[sign(r)==1]+rplus)
lines(x[sign(r)==-1],yhat[sign(r)==-1]+rminus)
@lukasb23
Copy link

etwas komplexer, aber funzt ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment