opar <- par(mfrow=c(1,1))
k <- 60; m <- c(0,0); a <- 2; b <- 1; phi <- pi/7
df1 <- 2; df2 <- 20
# show F for different confidence levels:
p <- c(0.5, 0.75, 0.8, 0.95)
qf(p, df1, df2) # 0.717735 1.486984 1.746189 3.492828
el7 <- conf.ellipse(k,a,b,phi,df1,df2,p[2]) + m
plot(el7*1.3,type="n",xlab="Different confidence ellipses",ylab="")
lines(conf.ellipse(60,a,b,phi,df1,df2,p[1]) + m,lty=2,col="red")
lines(conf.ellipse(60,a,b,phi,df1,df2,p[3]) + m,lty=2,col="green")
lines(conf.ellipse(60,a,b,phi,df1,df2,p[4]) + m,lty=2,col="blue")
lines(el7,lty=2,col="orange")
legend(x="bottom",paste(as.character(p*100),rep("%",length(p)),sep=""),
col = c("red", "orange","green","blue"), text.col="black", lty = c(2,2,2,2),
merge = TRUE, bg='white', cex=0.9)
par(opar)
Run the code above in your browser using DataLab