vignettes/jeksterslabRlinreg.Rmd
jeksterslabRlinreg.Rmd
jeksterslabRlinreg
is a collection of functions that I find useful in studying linear regression concepts and methods.
You can install the released version of jeksterslabRlinreg
from GitHub with:
library(devtools)
install_github("jeksterslabds/jeksterslabRlinreg")
In this hypothetical example, we are interested in the association between wages and education. The regressor variable is years of education. The regressand variable is hourly wage in US dollars.
#> constant education
#> [1,] 1 13
#> [2,] 1 15
#> [3,] 1 15
#> [4,] 1 12
#> [5,] 1 10
#> [6,] 1 9
#> wages
#> [1,] 19.820360
#> [2,] 16.989265
#> [3,] 7.087103
#> [4,] 14.267644
#> [5,] 11.832182
#> [6,] 19.224067
jeksterslabRlinreg::linreg()
The jeksterslabRlinreg::linreg()
function fits a linear regression model using X
and y
. In this example, X
consists of a column of constants and years of education
and y
consists of hourly wages
in US dollars.
The output includes the following:
jeksterslabRlinreg::linreg(
X = X,
y = y
)