normalize.by.patient<-function(x,pat){
f<-try(lme(x~1,random=~1|pat))
out<-x;
if (!inherits(f, "try-error")) {f<-lme(x~1,random=~1|pat); out<-x-f$fitted[,2]}
return(out)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.