HW 4 - panel = function(x,y){ panel.xyplot(x,y)...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 library(lattice) load("C:\\lattice.RData") attach(keytime) kt14 <- keytime[keytime$subject==14,] kt14 <- keytime[keytime$subject==14,-1] dim(kt14) detach(keytime) attach(kt14) tapply(delay, list(session,run),sum) array<-tapply(delay, list(session,run),sum) dim(array) m<-matrix(tapply(delay,list(run,label,session), sum),400 , 21) m<-as.vector(t(m)) min(m) max(m) m<-m+0.1627 m sum(m) r<-m/sum(m) r fdelay<-r ldelay<-log(r) i <- 6 for(i in levels(label)) print(i) trellis.device(pdf, file="C:\\Users\\phuppo\\Desktop\\HW4.pdf") bwplot(fdelay~label, data=kt14, aspect=1, scales = "free", sub = list("Box Plot",cex=.8), xlab="Delay") xyplot(ldelay~run|session*label, data = kt14, prepanel=function(x,y) prepanel.loess(x,y, degree = 1, family = "s", span = 3, evaluation = 50),
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: panel = function(x,y){ panel.xyplot(x,y) panel.loess(x,y, degree = 1, family = &quot;s&quot;, span = 3, evaluation = 50) }, layout = c(4,2), scales = &quot;same&quot;, pch = &quot;.&quot;, cex = .2, sub = list(&quot;XY PLOT WITH LOESS FITTING&quot;,cex=.8), aspect = 1.0) qqmath(~ ldelay | session, Sheet1 Page 2 data=kt14, prepanel = prepanel.qqmathline, panel = function(x, . ..) { panel.grid() panel.qqmathline(x, distribution = qnorm) panel.qqmath(x, . ..) }, scales = &quot;same&quot;, layout = c(2,2), pch=&quot;.&quot;, cex=2, sub = list(&quot;Normal QQ Plot&quot;,cex=.8), xlab = &quot;Unit Normal Quantile&quot;, ylab=&quot;log fdelay&quot;) graphics.off() bwplot(inv~label, data=kt14, aspect=1, sub = list(&quot;Box Plot&quot;,cex=.8), xlab=&quot;Delay&quot;)...
View Full Document

Page1 / 2

HW 4 - panel = function(x,y){ panel.xyplot(x,y)...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online