x <- rnorm(100, sd=3)
y <- rnorm(100)
plot(x, y, asp=1)
ce095 <- conf_ell(x, y, conf=0.95) # no need for conf arg since it's .95 by default
ce090 <- conf_ell(x, y, conf=0.90)
ce050 <- conf_ell(x, y, conf=0.50)
cols <- col_hot(10)
lines(ce050$ell, col=cols[5]) # you can also coo_close(ce050$ell)
lines(ce090$ell, col=cols[8])
lines(ce095$ell, col=cols[9])
segments(ce095$seg[1, 1], ce095$seg[1, 2], ce095$seg[2, 1], ce095$seg[2, 2])
segments(ce095$seg[3, 1], ce095$seg[3, 2], ce095$seg[4, 1], ce095$seg[4, 2])
Run the code above in your browser using DataLab