그 중 plotlm
함수는 정말 유용한 것 같습니다.
x <- 1:10
y <- 1:10 + rnorm(10)
beginr::plotlm(x, y, xlim = range(as.numeric(x), na.rm = TRUE),
ylim = range(as.numeric(y), na.rm = TRUE), plot.title = "linear regression", xlab = "x", ylab = "y",
refline = TRUE, slope = 1, intercept = 0, showr2 = TRUE, showleg = TRUE)
## [[1]]
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.3852634 0.43099484 -0.8938933 3.974728e-01
## x 1.0393962 0.06946111 14.9637147 3.926464e-07
##
## [[2]]
## [1] 0.9655043