Draw a trend arrow with confidence interval
Let draw an arrow with its width being dependent on the confidence interval: drawTrend <- function(x, y, show.circle=TRUE, show.0=TRUE) { model <- lm(y ~ x) direction.se <- coef(summary(model))["x", "Std. Error"] direction <- model$coefficients["x"] library("car") k <- ellipse(center=c(0.5, 0), radius=c(0.5, 0.5), shape=matrix(data = c(1, 0, 0, 1), nrow=2), segments=1001, draw = FALSE) par(mar=c(0, 0, 0, 0)) plot(x = c(0, 0), y=c(0, 0), type="n", bty="n", xlim=c(-0.1,1.1), ylim=c(-0.6, 0.6), las=1, asp=1, xaxt="n", yaxt="n", xlab="", ylab = "") if (show.circle) polygon(k[, 1], k[, 2], lwd=1) maxy <- which.max(k[, 2]) maxx <- which.max(k[, 1]) miny <- which.min(k[, 2]) minx <- which.min(k[, 1]) if (show.circle) { s <- seq(from=maxy, to=maxx, leng...