Skip to content

Instantly share code, notes, and snippets.

require("RColorBrewer")
# not run:
# model = lm(y~x1+x2+x3+x4...)
# Construct quantile table for varialbes of interest
# t value: n-p=df.residual=634, alpha=5%,50%. t(1-alpha/2, n-p)
t.05 <- qt(1-0.025, 634, lower.tail = TRUE, log.p=FALSE)
t.5 <- qt(1-0.25, 634, lower.tail = TRUE, log.p=FALSE)
coef.quantil <- data.frame(matrix(0, nrow=length(model$coefficients)-1, ncol=8))